From 4af6912e43237c3678f05e30c69385481f42ae76 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 12 May 2009 14:46:41 +0000 Subject: bku web start git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@354 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/keystore.ks | Bin 0 -> 5635 bytes BKUWebStart/pom.xml | 239 +++++++++++++++++++++ .../java/at/gv/egiz/bku/webstart/BKULauncher.java | 221 +++++++++++++++++++ .../src/main/java/at/gv/egiz/bku/webstart/CA.java | 117 ++++++++++ .../java/at/gv/egiz/bku/webstart/Container.java | 86 ++++++++ .../bku/webstart/ui/BKUControllerInterface.java | 23 ++ .../at/gv/egiz/bku/webstart/ui/TrayIconDialog.java | 202 +++++++++++++++++ .../bku/webstart/ui/TrayIconDialogInterface.java | 33 +++ BKUWebStart/src/main/jnlp/resources/logo.png | Bin 0 -> 2609 bytes BKUWebStart/src/main/jnlp/resources/logo_64x64.png | Bin 0 -> 2299 bytes BKUWebStart/src/main/jnlp/resources/logo_90x90.png | Bin 0 -> 3294 bytes BKUWebStart/src/main/jnlp/resources/splash.png | Bin 0 -> 54978 bytes BKUWebStart/src/main/jnlp/template.xml | 37 ++++ .../gv/egiz/bku/webstart/defaultConf/template.zip | Bin 0 -> 24829 bytes .../gv/egiz/bku/webstart/ui/UIMessages.properties | 13 ++ .../at/gv/egiz/bku/webstart/ui/favicon.png | Bin 0 -> 2149 bytes .../resources/at/gv/egiz/bku/webstart/ui/logo.png | Bin 0 -> 1751 bytes BKUWebStart/src/main/resources/log4j.properties | 16 ++ BKUWebStart/src/main/resources/logo.png | Bin 0 -> 2299 bytes BKUWebStart/src/main/resources/logo_32x32.png | Bin 0 -> 1522 bytes BKUWebStart/src/main/resources/logo_90x90.png | Bin 0 -> 3294 bytes BKUWebStart/src/main/resources/logo_RGB22x22.png | Bin 0 -> 1751 bytes BKUWebStart/src/main/resources/logo_RGB32x32.png | Bin 0 -> 2609 bytes BKUWebStart/src/main/resources/splash.png | Bin 0 -> 54978 bytes BKUWebStart/src/main/webapp/WEB-INF/web.xml | 7 + BKUWebStart/src/main/webapp/launch.html | 17 ++ BKUWebStart/src/main/webapp/launch.jnlp | 30 +++ BKUWebStart/src/main/webapp/mocca_tiny.png | Bin 0 -> 1025 bytes BKUWebStart/src/main/webapp/splash.png | Bin 0 -> 54978 bytes 29 files changed, 1041 insertions(+) create mode 100644 BKUWebStart/keystore.ks create mode 100644 BKUWebStart/pom.xml create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java create mode 100644 BKUWebStart/src/main/jnlp/resources/logo.png create mode 100644 BKUWebStart/src/main/jnlp/resources/logo_64x64.png create mode 100644 BKUWebStart/src/main/jnlp/resources/logo_90x90.png create mode 100644 BKUWebStart/src/main/jnlp/resources/splash.png create mode 100644 BKUWebStart/src/main/jnlp/template.xml create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png create mode 100644 BKUWebStart/src/main/resources/log4j.properties create mode 100644 BKUWebStart/src/main/resources/logo.png create mode 100644 BKUWebStart/src/main/resources/logo_32x32.png create mode 100644 BKUWebStart/src/main/resources/logo_90x90.png create mode 100644 BKUWebStart/src/main/resources/logo_RGB22x22.png create mode 100644 BKUWebStart/src/main/resources/logo_RGB32x32.png create mode 100644 BKUWebStart/src/main/resources/splash.png create mode 100644 BKUWebStart/src/main/webapp/WEB-INF/web.xml create mode 100644 BKUWebStart/src/main/webapp/launch.html create mode 100644 BKUWebStart/src/main/webapp/launch.jnlp create mode 100644 BKUWebStart/src/main/webapp/mocca_tiny.png create mode 100644 BKUWebStart/src/main/webapp/splash.png (limited to 'BKUWebStart') diff --git a/BKUWebStart/keystore.ks b/BKUWebStart/keystore.ks new file mode 100644 index 00000000..824c3a40 Binary files /dev/null and b/BKUWebStart/keystore.ks differ diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml new file mode 100644 index 00000000..c61937bb --- /dev/null +++ b/BKUWebStart/pom.xml @@ -0,0 +1,239 @@ + + + + bku + at.gv.egiz + 1.1.2-SNAPSHOT + + 4.0.0 + at.gv.egiz + BKUWebStart + jar + BKU Web Start + 1.0-SNAPSHOT + http://danu-lin.iaik.tugraz.at:8080/jnlp + Web Start Bürgerkartenumgebung (BKU) MOCCA-lokal + + + + BKUWebStart + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-dependencies + package + + unpack-dependencies + + + at.gv.egiz + BKULocal + war + + ${project.build.directory}/classes/BKULocalWar + false + true + + + + + + + org.codehaus.mojo.webstart + webstart-maven-plugin + + + + jnlp + + package + + + + + + + false + + + lib + + + + + + commons-logging:commons-logging + log4j:log4j + at.gv.egiz:utils + javax.activation:activation + iaik:iaik_ecc + iaik:iaik_jce + iaik:iaik_xsect_unsigned + org.mortbay.jetty:jetty + org.mortbay.jetty:jetty-util + org.mortbay.jetty:servlet-api + + + + + + + + + + + src/main/jnlp/template.xml + mocca.jnlp + + + + at.gv.egiz.bku.webstart.BKULauncher + + 1.6+ + + + + + + + + test-applet signer + ${project.basedir}/keystore.ks + storepass + keypass + + + + + + + + true + + + + false + false + + + + + + false + false + + + true + + + true + + + true + + + + + + + + + + + + + at.gv.egiz + BKULocal + 1.0.5-SNAPSHOT + war + + + utils + at.gv.egiz + 1.1.2-SNAPSHOT + + + iaik_jce + iaik + 3.16 + + + iaik_ecc + iaik + 2.15 + + + iaik_xsect_unsigned + iaik + 1.14 + + + commons-logging + commons-logging + 1.0.4 + + + org.mortbay.jetty + jetty + 6.1.15 + + + + + + + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java new file mode 100644 index 00000000..854e6535 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -0,0 +1,221 @@ +package at.gv.egiz.bku.webstart; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.security.KeyStore; +import java.util.Enumeration; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +//import org.apache.commons.cli.CommandLine; +//import org.apache.commons.cli.CommandLineParser; +//import org.apache.commons.cli.HelpFormatter; +//import org.apache.commons.cli.Options; +//import org.apache.commons.cli.ParseException; +//import org.apache.commons.cli.PosixParser; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.webstart.ui.BKUControllerInterface; +import at.gv.egiz.bku.webstart.ui.TrayIconDialog; +import at.gv.egiz.bku.utils.StreamUtil; + +public class BKULauncher implements BKUControllerInterface { + + private static Log log = LogFactory.getLog(BKULauncher.class); + + private ResourceBundle resourceBundle = null; + private Container server; +// private SplashScreen splash = SplashScreen.getSplashScreen(); + + private void startUpServer() throws Exception { + server = new Container(); + // XmlConfiguration xcfg = new XmlConfiguration(getClass().getClassLoader() + // .getResourceAsStream("at/gv/egiz/bku/local/app/jetty.xml")); + // xcfg.configure(server); + server.init(); + server.start(); + } + + private void initTrayIcon() { + Locale loc = Locale.getDefault(); + try { + resourceBundle = ResourceBundle.getBundle( + "at/gv/egiz/bku/webstart/ui/UIMessages", loc); + } catch (MissingResourceException mx) { + resourceBundle = ResourceBundle.getBundle( + "at/gv/egiz/bku/webstart/ui/UIMessages", Locale.ENGLISH); + } + TrayIconDialog.getInstance().init(resourceBundle); + TrayIconDialog.getInstance().setShutdownHook(this); + TrayIconDialog.getInstance().displayInfo("Greetings.Caption", + "Greetings.Message"); + } + + private void initStart() { + + } + + private void initFinished() { + try { +// if (splash != null) { +// try { +// splash.close(); +// } catch (IllegalStateException ex) { +// log.warn("Failed to close splash screen: " + ex.getMessage()); +// } +// } + server.join(); + } catch (InterruptedException e) { + log.info(e); + } + } + +// private void copyDirs(File srcDir, File dstDir) { +// for (File cf : srcDir.listFiles()) { +// File of = new File(dstDir, cf.getName()); +// if (cf.isDirectory()) { +// log.debug("Creating directory: " + of); +// of.mkdir(); +// copyDirs(cf, of); +// } else { +// log.debug("Writing file: " + of); +// try { +// FileInputStream fis = new FileInputStream(cf); +// FileOutputStream fos = new FileOutputStream(of); +// StreamUtil.copyStream(fis, fos); +// fis.close(); +// fos.close(); +// } catch (IOException e) { +// log.error("Cannot copy default configuration", e); +// } +// } +// } +// } + + private void unzip(File zipfile) throws IOException { + File dir = zipfile.getParentFile(); + ZipFile zipFile = new ZipFile(zipfile); + Enumeration entries = zipFile.entries(); + while (entries.hasMoreElements()) { + ZipEntry entry = entries.nextElement(); + File eF = new File(dir, entry.getName()); + if (entry.isDirectory()) { + eF.mkdirs(); + continue; + } + File f = new File(eF.getParent()); + f.mkdirs(); + StreamUtil.copyStream(zipFile.getInputStream(entry), + new FileOutputStream(eF)); + } + zipFile.close(); + } + + private void checkConfig(String[] args) { +// CommandLineParser parser = new PosixParser(); +// Options options = new Options(); +// options.addOption("c", true, "the configuration's base directory"); +// options.addOption("h", false, "print this message"); +// try { + File cfgDir = new File(System.getProperty("user.home") + "/.mocca/conf"); +// CommandLine cmd = parser.parse(options, args); +// if (cmd.hasOption("h")) { +// HelpFormatter formatter = new HelpFormatter(); +// formatter.printHelp("BKULauncher", options); +// System.exit(0); +// } +// +// if (cmd.hasOption("c")) { +// cfgDir = new File(cmd.getOptionValue("c")); +// } + log.debug("using config directory: " + cfgDir); + if (cfgDir.exists() && cfgDir.isFile()) { + log.error("Configuration directory must not be a file"); + } + if (!cfgDir.exists()) { + log.debug("Creating config directory: " + cfgDir); + cfgDir.mkdirs(); + try { + InputStream is = getClass().getClassLoader().getResourceAsStream( + "at/gv/egiz/bku/webstart/defaultConf/template.zip"); + OutputStream os = new FileOutputStream(new File(cfgDir, + "template.zip")); + StreamUtil.copyStream(is, os); + os.close(); + unzip(new File(cfgDir, "template.zip")); + } catch (IOException iox) { + log.error("Cannot create user directory", iox); + return; + } + CA ca = new CA(); + char[] password = "changeMe".toCharArray(); + KeyStore ks = ca.generateKeyStore(password); + if (ks != null) { + File ksdir = new File(cfgDir, "keystore"); + ksdir.mkdirs(); + FileOutputStream fos; + try { + fos = new FileOutputStream(new File(ksdir, "keystore.ks")); + ks.store(fos, password); + fos.close(); + } catch (Exception e) { + log.error("Cannot store keystore", e); + } + } else { + log.error("Cannot create ssl certificate"); + } + } +// } catch (ParseException e1) { +// log.error(e1); +// HelpFormatter formatter = new HelpFormatter(); +// formatter.printHelp("BKULauncher", options); +// System.exit(0); +// } + } + + /** + * @param args + */ + public static void main(String[] args) { + try { + log.warn("***** DISABLING SECURITY MANAGER *******"); + System.setSecurityManager(null); + BKULauncher launcher = new BKULauncher(); + launcher.initStart(); + launcher.checkConfig(args); + launcher.startUpServer(); + launcher.initTrayIcon(); + launcher.initFinished(); + } catch (Exception e) { + log.fatal("Cannot launch BKU", e); + System.exit(-1000); + } + + } + + public void shutDown() { + log.info("Shutting down server"); + if ((server != null) && (server.isRunning())) { + try { + if (server.isRunning()) { + server.stop(); + } + } catch (Exception e) { + log.debug(e.toString()); + } finally { + if (server.isRunning()) { + server.destroy(); + } + } + } + System.exit(0); + } + +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java new file mode 100644 index 00000000..f81d3d83 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java @@ -0,0 +1,117 @@ +package at.gv.egiz.bku.webstart; + +import iaik.asn1.ObjectID; +import iaik.asn1.structures.AlgorithmID; +import iaik.asn1.structures.Name; +import iaik.x509.X509Certificate; +import iaik.x509.extensions.BasicConstraints; +import iaik.x509.extensions.KeyUsage; + +import java.math.BigInteger; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.security.GeneralSecurityException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.Random; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class CA { + private final static Log log = LogFactory.getLog(CA.class); + + private KeyPair caKeyPair; + private X509Certificate caCert; + + private KeyPair serverKeyPair; + private X509Certificate serverCert; + + public CA() { + } + + private KeyPair generateKeyPair() throws NoSuchAlgorithmException { + KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA"); + gen.initialize(2048); + return gen.generateKeyPair(); + } + + private void generateCA() throws GeneralSecurityException { + log.debug("Generating CA certificate"); + Name subject = new Name(); + subject.addRDN(ObjectID.country, "AT"); + subject.addRDN(ObjectID.organization, "MOCCA"); + subject.addRDN(ObjectID.organizationalUnit, "MOCCA-CA"); + + caKeyPair = generateKeyPair(); + caCert = new X509Certificate(); + caCert.setSerialNumber(new BigInteger(20, new Random())); + caCert.setSubjectDN(subject); + caCert.setPublicKey(caKeyPair.getPublic()); + caCert.setIssuerDN(subject); + + caCert.addExtension(new BasicConstraints(true)); + caCert.addExtension(new KeyUsage(KeyUsage.keyCertSign | KeyUsage.cRLSign + | KeyUsage.digitalSignature)); + + GregorianCalendar date = new GregorianCalendar(); + date.add(Calendar.HOUR_OF_DAY, -1); + caCert.setValidNotBefore(date.getTime()); + date.add(Calendar.YEAR, 7); + caCert.setValidNotAfter(date.getTime()); + caCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate()); + log.debug("Successfully signed CA certificate"); + } + + private void generateServerCert() throws GeneralSecurityException { + log.debug("Generating SSL certificate"); + Name subject = new Name(); + subject.addRDN(ObjectID.country, "AT"); + subject.addRDN(ObjectID.organization, "MOCCA"); + try { + subject.addRDN(ObjectID.commonName, InetAddress.getLocalHost() + .getHostName()); + } catch (UnknownHostException e) { + subject.addRDN(ObjectID.commonName, "localhost"); + } + serverKeyPair = generateKeyPair(); + serverCert = new X509Certificate(); + serverCert.setSerialNumber(new BigInteger(20, new Random())); + serverCert.setSubjectDN(subject); + serverCert.setPublicKey(serverKeyPair.getPublic()); + serverCert.setIssuerDN(caCert.getSubjectDN()); + + serverCert.addExtension(new BasicConstraints(false)); + serverCert.addExtension(new KeyUsage(KeyUsage.keyEncipherment + | KeyUsage.digitalSignature)); + + GregorianCalendar date = new GregorianCalendar(); + date.add(Calendar.HOUR_OF_DAY, -1); + serverCert.setValidNotBefore(date.getTime()); + date.add(Calendar.YEAR, 7); + date.add(Calendar.HOUR_OF_DAY, -1); + serverCert.setValidNotAfter(date.getTime()); + serverCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate()); + log.debug("Successfully signed server certificate"); + caKeyPair = null; + } + + public KeyStore generateKeyStore(char[] password) { + try { + generateCA(); + generateServerCert(); + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(null, null); + ks.setKeyEntry("server", serverKeyPair.getPrivate(), password, new X509Certificate[]{serverCert, caCert}); + return ks; + } catch (Exception e) { + log.error("Cannot generate certificate", e); + } + return null; + } + +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java new file mode 100644 index 00000000..ef12e4fd --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -0,0 +1,86 @@ +package at.gv.egiz.bku.webstart; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mortbay.jetty.Connector; +import org.mortbay.jetty.Handler; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.handler.DefaultHandler; +import org.mortbay.jetty.handler.HandlerCollection; +import org.mortbay.jetty.nio.SelectChannelConnector; +import org.mortbay.jetty.security.SslSocketConnector; +import org.mortbay.jetty.webapp.WebAppContext; +import org.mortbay.thread.QueuedThreadPool; + +public class Container { + + public static final String HTTP_PORT = "mocca.http.port"; + public static final String HTTPS_PORT = "mocca.http.port"; + + private static Log log = LogFactory.getLog(Container.class); + + private Server server; + + public Container() { + } + + public void init() { + server = new Server(); + QueuedThreadPool qtp = new QueuedThreadPool(); + qtp.setMaxThreads(5); + qtp.setMinThreads(2); + qtp.setLowThreads(0); + server.setThreadPool(qtp); + server.setStopAtShutdown(true); + server.setGracefulShutdown(3000); + + SelectChannelConnector connector = new SelectChannelConnector(); + connector.setPort(Integer.getInteger(HTTP_PORT, 3495).intValue()); + connector.setAcceptors(1); + connector.setConfidentialPort(Integer.getInteger(HTTPS_PORT, 3496).intValue()); + + SslSocketConnector sslConnector = new SslSocketConnector(); + sslConnector.setPort(Integer.getInteger(HTTPS_PORT, 3496).intValue()); + sslConnector.setAcceptors(1); + sslConnector.setKeystore(System.getProperty("user.home") + + "/.mocca/conf/keystore/keystore.ks"); + sslConnector.setPassword("changeMe"); + sslConnector.setKeyPassword("changeMe"); + + server.setConnectors(new Connector[] { connector, sslConnector }); + +// HandlerCollection handlers = new HandlerCollection(); + WebAppContext webapp = new WebAppContext(); + webapp.setContextPath("/"); + webapp.setExtractWAR(true); //false + webapp.setParentLoaderPriority(false); + +// webappcontext.setWar("BKULocal-1.0.4-SNAPSHOT.war"); + webapp.setWar(getClass().getClassLoader().getResource("BKULocalWar/").toString()); + +// handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() }); + + server.setHandler(webapp); + server.setGracefulShutdown(1000*3); + } + + public void start() throws Exception { + server.start(); + } + + public boolean isRunning() { + return server.isRunning(); + } + + public void stop() throws Exception { + server.stop(); + } + + public void destroy() { + server.destroy(); + } + + public void join() throws InterruptedException { + server.join(); + } +} \ No newline at end of file diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java new file mode 100644 index 00000000..fd9838f9 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java @@ -0,0 +1,23 @@ +/* +* 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.ui; + +public interface BKUControllerInterface { + + public void shutDown(); + +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java new file mode 100644 index 00000000..4679eac5 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java @@ -0,0 +1,202 @@ +/* +* 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.ui; + +import java.awt.AWTException; +import java.awt.Image; +import java.awt.MenuItem; +import java.awt.PopupMenu; +import java.awt.SystemTray; +import java.awt.TrayIcon; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.ResourceBundle; + +import javax.imageio.ImageIO; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class TrayIconDialog implements TrayIconDialogInterface { + + private static Log log = LogFactory.getLog(TrayIconDialog.class); + private static TrayIconDialogInterface instance; + private boolean isSupported; + private BKUControllerInterface shutDown; + private TrayIcon trayIcon = null; + private ResourceBundle resourceBundle = null; + + private TrayIconDialog() { + } + + private void displayTrayMsg(String captionID, String messageID, + TrayIcon.MessageType type) { + if ((isSupported) && (resourceBundle != null)) { + try { + trayIcon.displayMessage(resourceBundle.getString(captionID), + resourceBundle.getString(messageID), type); + } catch (Exception ex) { + log.error(ex); + } + } + } + + /* + * (non-Javadoc) + * + * @see + * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#displayInfo(java.lang.String + * , java.lang.String) + */ + public void displayInfo(String captionID, String messageID) { + displayTrayMsg(captionID, messageID, TrayIcon.MessageType.INFO); + } + + /* + * (non-Javadoc) + * + * @see + * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#displayWarning(java.lang + * .String, java.lang.String) + */ + public void displayWarning(String captionID, String messageID) { + displayTrayMsg(captionID, messageID, TrayIcon.MessageType.WARNING); + } + + /* + * (non-Javadoc) + * + * @see + * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#displayError(java.lang. + * String, java.lang.String) + */ + public void displayError(String captionID, String messageID) { + displayTrayMsg(captionID, messageID, TrayIcon.MessageType.ERROR); + } + + /* + * (non-Javadoc) + * + * @see + * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#init(java.util.ResourceBundle + * ) + */ + public void init(ResourceBundle resourceBundel) { + this.resourceBundle = resourceBundel; + isSupported = SystemTray.isSupported(); + log.info("Trayicon supported: " + isSupported); + try { + if (isSupported) { + SystemTray tray = SystemTray.getSystemTray(); + Image image = ImageIO.read(getClass().getClassLoader() + .getResourceAsStream("at/gv/egiz/bku/webstart/ui/logo.png")); + PopupMenu popup = new PopupMenu(); + MenuItem exitItem = new MenuItem(resourceBundel + .getString("TrayMenu.Shutdown")); + popup.add(exitItem); + exitItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + log.info("Calling Shutdown"); + if (shutDown != null) { + shutDown.shutDown(); + } + } + }); + + trayIcon = new TrayIcon(image, "BKULogo", popup); + trayIcon.setImageAutoSize(true); + trayIcon.setToolTip(resourceBundel.getString("TrayMenu.Tooltip")); + try { + tray.add(trayIcon); + } catch (AWTException e) { + log.error("TrayIcon could not be added.", e); + isSupported = false; + } + } + } catch (IOException e) { + log.error(e); + } + } + + /* + * (non-Javadoc) + * + * @see + * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#setShutdownHook(at.gv.egiz + * .bku.local.ui.BKUControllerInterface) + */ + public void setShutdownHook(BKUControllerInterface shutDown) { + this.shutDown = shutDown; + } + + @SuppressWarnings("unchecked") + public synchronized static TrayIconDialogInterface getInstance() { + ClassLoader cl = TrayIconDialog.class.getClassLoader(); + if (instance == null) { + if (cl.toString().equals(cl.getParent().toString())) { + instance = new TrayIconDialog(); + return instance; + } + ClassLoader parent = cl; + while (!parent.toString().equals(cl.getParent().toString())) { + parent = parent.getParent(); + } + try { + Class otherClassInstance = (Class) parent + .loadClass(TrayIconDialog.class.getName()); + Method getInstanceMethod = otherClassInstance.getDeclaredMethod( + "getInstance", new Class[] {}); + Object otherSingleton = getInstanceMethod.invoke(null, new Object[] {}); + instance = (TrayIconDialogInterface) Proxy.newProxyInstance(cl, + new Class[] { TrayIconDialogInterface.class }, + new PassThroughProxyHandler(otherSingleton)); + } catch (ClassNotFoundException ce) { + instance = new TrayIconDialog(); + } catch (Exception e) { + log.error(e); + instance = new TrayIconDialog(); + } + return instance; + } + return instance; + } + + /** + * + * Only works for public methods + * + */ + static class PassThroughProxyHandler implements InvocationHandler { + private final Object delegate; + + public PassThroughProxyHandler(Object delegate) { + this.delegate = delegate; + } + + public Object invoke(Object proxy, Method method, Object[] args) + throws Throwable { + Method delegateMethod = delegate.getClass().getMethod(method.getName(), + method.getParameterTypes()); + return delegateMethod.invoke(delegate, args); + } + } + +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java new file mode 100644 index 00000000..078844cb --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java @@ -0,0 +1,33 @@ +/* +* 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.ui; + +import java.util.ResourceBundle; + +public interface TrayIconDialogInterface { + + public abstract void displayInfo(String captionID, String messageID); + + public abstract void displayWarning(String captionID, String messageID); + + public abstract void displayError(String captionID, String messageID); + + public abstract void init(ResourceBundle resourceBundel); + + public abstract void setShutdownHook(BKUControllerInterface shutDown); + +} \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/resources/logo.png b/BKUWebStart/src/main/jnlp/resources/logo.png new file mode 100644 index 00000000..2c622d88 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/logo.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/logo_64x64.png b/BKUWebStart/src/main/jnlp/resources/logo_64x64.png new file mode 100644 index 00000000..fa6d7f96 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/logo_64x64.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/logo_90x90.png b/BKUWebStart/src/main/jnlp/resources/logo_90x90.png new file mode 100644 index 00000000..d7f8bbd0 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/logo_90x90.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/splash.png b/BKUWebStart/src/main/jnlp/resources/splash.png new file mode 100644 index 00000000..72c1d868 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/splash.png differ diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml new file mode 100644 index 00000000..0a89a036 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -0,0 +1,37 @@ + + + + $project.Name + $project.Organization.Name + + $project.Description + + + + + + + +#if($offlineAllowed) + +#end + + + + +#if($allPermissions) + + + +#end + + + + + + + $dependencies + + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip new file mode 100644 index 00000000..f14b0c19 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties new file mode 100644 index 00000000..873d03ef --- /dev/null +++ b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties @@ -0,0 +1,13 @@ +#-------- tray icon messages ------- +TrayMenu.Tooltip=MOCCA +TrayMenu.Shutdown=MOCCA Beenden + +Greetings.Message=MOCCA up and running +Greetings.Caption=MOCCA Started + +Message.RequestCaption=New Request +Message.InfoboxReadRequest=Reading Infobox +Message.SecureSignatureKeypair=Reading secure signature certificate +Message.CertifiedKeypair=Reading certified certificate +Message.IdentityLink=Reading Identitylink +Message.SignRequest=Creating Signature \ No newline at end of file diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png new file mode 100644 index 00000000..2d0276de Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png new file mode 100644 index 00000000..598ab00b Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png differ diff --git a/BKUWebStart/src/main/resources/log4j.properties b/BKUWebStart/src/main/resources/log4j.properties new file mode 100644 index 00000000..4df33ab5 --- /dev/null +++ b/BKUWebStart/src/main/resources/log4j.properties @@ -0,0 +1,16 @@ +# loglever DEBUG, appender STDOUT +log4j.rootLogger=TRACE, STDOUT, file + +# STDOUT appender +log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender +log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout +#log4j.appender.STDOUT.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n +#log4j.appender.STDOUT.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n +log4j.appender.STDOUT.layout.ConversionPattern=%-5p |%d | %t | %c %x- %m%n + +### FILE appender +log4j.appender.file=org.apache.log4j.DailyRollingFileAppender +log4j.appender.file.datePattern='.'yyyy-MM-dd +log4j.appender.file.File=${user.home}/.mocca/logs/webstart.log +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n \ No newline at end of file diff --git a/BKUWebStart/src/main/resources/logo.png b/BKUWebStart/src/main/resources/logo.png new file mode 100644 index 00000000..fa6d7f96 Binary files /dev/null and b/BKUWebStart/src/main/resources/logo.png differ diff --git a/BKUWebStart/src/main/resources/logo_32x32.png b/BKUWebStart/src/main/resources/logo_32x32.png new file mode 100644 index 00000000..337b144b Binary files /dev/null and b/BKUWebStart/src/main/resources/logo_32x32.png differ diff --git a/BKUWebStart/src/main/resources/logo_90x90.png b/BKUWebStart/src/main/resources/logo_90x90.png new file mode 100644 index 00000000..d7f8bbd0 Binary files /dev/null and b/BKUWebStart/src/main/resources/logo_90x90.png differ diff --git a/BKUWebStart/src/main/resources/logo_RGB22x22.png b/BKUWebStart/src/main/resources/logo_RGB22x22.png new file mode 100644 index 00000000..598ab00b Binary files /dev/null and b/BKUWebStart/src/main/resources/logo_RGB22x22.png differ diff --git a/BKUWebStart/src/main/resources/logo_RGB32x32.png b/BKUWebStart/src/main/resources/logo_RGB32x32.png new file mode 100644 index 00000000..2c622d88 Binary files /dev/null and b/BKUWebStart/src/main/resources/logo_RGB32x32.png differ diff --git a/BKUWebStart/src/main/resources/splash.png b/BKUWebStart/src/main/resources/splash.png new file mode 100644 index 00000000..72c1d868 Binary files /dev/null and b/BKUWebStart/src/main/resources/splash.png differ diff --git a/BKUWebStart/src/main/webapp/WEB-INF/web.xml b/BKUWebStart/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..9f88c1f9 --- /dev/null +++ b/BKUWebStart/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,7 @@ + + + + Archetype Created Web Application + diff --git a/BKUWebStart/src/main/webapp/launch.html b/BKUWebStart/src/main/webapp/launch.html new file mode 100644 index 00000000..6ed6feb5 --- /dev/null +++ b/BKUWebStart/src/main/webapp/launch.html @@ -0,0 +1,17 @@ + + + + Test page for launching the application via JNLP + + +

Test page for launching the application via JNLP

+ Launch the application + + + + + + diff --git a/BKUWebStart/src/main/webapp/launch.jnlp b/BKUWebStart/src/main/webapp/launch.jnlp new file mode 100644 index 00000000..d51d9d21 --- /dev/null +++ b/BKUWebStart/src/main/webapp/launch.jnlp @@ -0,0 +1,30 @@ + + + + BKU Web Start + EGIZ + + BKU WebStart (aka. Lokale BKU) + BKU WebStart + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUWebStart/src/main/webapp/mocca_tiny.png b/BKUWebStart/src/main/webapp/mocca_tiny.png new file mode 100644 index 00000000..1f125d9b Binary files /dev/null and b/BKUWebStart/src/main/webapp/mocca_tiny.png differ diff --git a/BKUWebStart/src/main/webapp/splash.png b/BKUWebStart/src/main/webapp/splash.png new file mode 100644 index 00000000..72c1d868 Binary files /dev/null and b/BKUWebStart/src/main/webapp/splash.png differ -- cgit v1.2.3 From 0d5e54423b3cbc6c16b28800890c6ee5a5aacf75 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 12 Jun 2009 12:41:58 +0000 Subject: BKU Web Start git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@360 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/webstart/conf/template.zip | Bin 0 -> 24829 bytes .../gv/egiz/bku/webstart/defaultConf/template.zip | Bin 24829 -> 0 bytes BKUWebStart/src/main/webapp/WEB-INF/web.xml | 7 ----- BKUWebStart/src/main/webapp/launch.html | 17 ------------ BKUWebStart/src/main/webapp/launch.jnlp | 30 --------------------- BKUWebStart/src/main/webapp/mocca_tiny.png | Bin 1025 -> 0 bytes BKUWebStart/src/main/webapp/splash.png | Bin 54978 -> 0 bytes 7 files changed, 54 deletions(-) create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip delete mode 100644 BKUWebStart/src/main/webapp/WEB-INF/web.xml delete mode 100644 BKUWebStart/src/main/webapp/launch.html delete mode 100644 BKUWebStart/src/main/webapp/launch.jnlp delete mode 100644 BKUWebStart/src/main/webapp/mocca_tiny.png delete mode 100644 BKUWebStart/src/main/webapp/splash.png (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip new file mode 100644 index 00000000..f14b0c19 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip deleted file mode 100644 index f14b0c19..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/defaultConf/template.zip and /dev/null differ diff --git a/BKUWebStart/src/main/webapp/WEB-INF/web.xml b/BKUWebStart/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 9f88c1f9..00000000 --- a/BKUWebStart/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - Archetype Created Web Application - diff --git a/BKUWebStart/src/main/webapp/launch.html b/BKUWebStart/src/main/webapp/launch.html deleted file mode 100644 index 6ed6feb5..00000000 --- a/BKUWebStart/src/main/webapp/launch.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Test page for launching the application via JNLP - - -

Test page for launching the application via JNLP

- Launch the application - - - - - - diff --git a/BKUWebStart/src/main/webapp/launch.jnlp b/BKUWebStart/src/main/webapp/launch.jnlp deleted file mode 100644 index d51d9d21..00000000 --- a/BKUWebStart/src/main/webapp/launch.jnlp +++ /dev/null @@ -1,30 +0,0 @@ - - - - BKU Web Start - EGIZ - - BKU WebStart (aka. Lokale BKU) - BKU WebStart - - - - - - - - - - - - - - - - - - - - - - diff --git a/BKUWebStart/src/main/webapp/mocca_tiny.png b/BKUWebStart/src/main/webapp/mocca_tiny.png deleted file mode 100644 index 1f125d9b..00000000 Binary files a/BKUWebStart/src/main/webapp/mocca_tiny.png and /dev/null differ diff --git a/BKUWebStart/src/main/webapp/splash.png b/BKUWebStart/src/main/webapp/splash.png deleted file mode 100644 index 72c1d868..00000000 Binary files a/BKUWebStart/src/main/webapp/splash.png and /dev/null differ -- cgit v1.2.3 From 61366ba8efcc0cf3d36438e9ee26228e7bc66174 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 12 Jun 2009 12:42:05 +0000 Subject: BKU Web Start git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@361 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 330 +++++++++++--------- .../java/at/gv/egiz/bku/webstart/BKULauncher.java | 339 +++++++++++++++------ .../src/main/java/at/gv/egiz/bku/webstart/CA.java | 117 ------- .../java/at/gv/egiz/bku/webstart/Container.java | 60 ++-- .../java/at/gv/egiz/bku/webstart/TLSServerCA.java | 138 +++++++++ .../at/gv/egiz/bku/webstart/ui/TrayIconDialog.java | 9 +- BKUWebStart/src/main/jnlp/resources/img/logo.png | Bin 0 -> 2609 bytes .../src/main/jnlp/resources/img/logo_64x64.png | Bin 0 -> 2299 bytes .../src/main/jnlp/resources/img/logo_90x90.png | Bin 0 -> 3294 bytes BKUWebStart/src/main/jnlp/resources/img/splash.png | Bin 0 -> 54978 bytes .../src/main/jnlp/resources/img/version.xml | 17 ++ BKUWebStart/src/main/jnlp/resources/logo.png | Bin 2609 -> 0 bytes BKUWebStart/src/main/jnlp/resources/logo_64x64.png | Bin 2299 -> 0 bytes BKUWebStart/src/main/jnlp/resources/logo_90x90.png | Bin 3294 -> 0 bytes BKUWebStart/src/main/jnlp/resources/splash.png | Bin 54978 -> 0 bytes BKUWebStart/src/main/jnlp/resources/version.xml | 186 +++++++++++ BKUWebStart/src/main/jnlp/template.xml | 13 +- .../resources/at/gv/egiz/bku/webstart/ui/logo.png | Bin 1751 -> 0 bytes .../at/gv/egiz/bku/webstart/ui/trayicon.png | Bin 0 -> 2609 bytes BKUWebStart/src/main/resources/logo.png | Bin 2299 -> 0 bytes BKUWebStart/src/main/resources/splash.png | Bin 54978 -> 0 bytes 21 files changed, 822 insertions(+), 387 deletions(-) delete mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/splash.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/version.xml delete mode 100644 BKUWebStart/src/main/jnlp/resources/logo.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/logo_64x64.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/logo_90x90.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/splash.png create mode 100644 BKUWebStart/src/main/jnlp/resources/version.xml delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png delete mode 100644 BKUWebStart/src/main/resources/logo.png delete mode 100644 BKUWebStart/src/main/resources/splash.png (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index c61937bb..ec5fd976 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -10,35 +10,17 @@ BKUWebStart jar BKU Web Start - 1.0-SNAPSHOT - http://danu-lin.iaik.tugraz.at:8080/jnlp - Web Start Bürgerkartenumgebung (BKU) MOCCA-lokal + + 1.0.3-SNAPSHOT + http://mocca.egovlabs.gv.at/ + Web Start Bürgerkartenumgebung (MOCCA-lokal) - BKUWebStart - - - + org.apache.maven.plugins maven-dependency-plugin + ${project.build.directory}/classes/BKULocalWar false true + + + + + copy BKULocal webapp + + copy-dependencies + + + at.gv.egiz + BKULocal + war + ${project.build.directory}/classes/ + true + @@ -85,113 +99,101 @@ org.codehaus.mojo.webstart webstart-maven-plugin - - - jnlp - - package - + + + package + + + jnlp-inline + + - - - - false - - - lib - - - - - - commons-logging:commons-logging - log4j:log4j - at.gv.egiz:utils - javax.activation:activation - iaik:iaik_ecc - iaik:iaik_jce - iaik:iaik_xsect_unsigned - org.mortbay.jetty:jetty - org.mortbay.jetty:jetty-util - org.mortbay.jetty:servlet-api - - - - - - - - - - - src/main/jnlp/template.xml - mocca.jnlp - - - - at.gv.egiz.bku.webstart.BKULauncher - - 1.6+ - - - - - - - - test-applet signer - ${project.basedir}/keystore.ks - storepass - keypass - - - - - - - - true - - - - false - false - - - - - - false - false - - - true - - - true - - - true + + false + + + + + + + ${project.basedir}/src/main/jnlp + template.xml + mocca.jnlp + at.gv.egiz.bku.webstart.BKULauncher + 1.6+ + true + true + + + + test-applet signer + ${project.basedir}/keystore.ks + storepass + keypass + true + + false + false + + + + + true + + + + true + + + true + + + true + + org.codehaus.mojo + maven-buildnumber-plugin + + + validate + + create + + + + + false + false + + - - - + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + ${project.version}-r${buildNumber} + + + true + + + at.gv.egiz @@ -204,21 +206,6 @@ at.gv.egiz 1.1.2-SNAPSHOT - - iaik_jce - iaik - 3.16 - - - iaik_ecc - iaik - 2.15 - - - iaik_xsect_unsigned - iaik - 1.14 - commons-logging commons-logging @@ -231,9 +218,56 @@ - - - - + \ No newline at end of file diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java index 854e6535..3d09fb00 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -1,15 +1,23 @@ package at.gv.egiz.bku.webstart; +import iaik.asn1.CodingException; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.MalformedURLException; import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; import java.util.Enumeration; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -25,16 +33,157 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.webstart.ui.BKUControllerInterface; import at.gv.egiz.bku.webstart.ui.TrayIconDialog; import at.gv.egiz.bku.utils.StreamUtil; +import java.awt.Desktop; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.net.URI; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.util.UUID; +import java.util.jar.Attributes; +import java.util.jar.Manifest; +import java.util.zip.ZipOutputStream; public class BKULauncher implements BKUControllerInterface { + /** configurations with less than this (major) version will be backuped and updated */ + public static final String MIN_CONFIG_VERSION = "1.0.3"; + public static final String CONFIG_DIR = ".mocca/conf/"; + public static final String CONF_TEMPLATE_FILE = "template.zip"; + public static final String CONF_TEMPLATE_RESOURCE = "at/gv/egiz/bku/webstart/conf/template.zip"; + public static final String WEBAPP_RESOURCE = "BKULocal.war"; + public static final String WEBAPP_FILE = "BKULocal.war"; + public static final String KEYSTORE_FILE = "keystore.ks"; + public static final String MESSAGES_RESOURCE = "at/gv/egiz/bku/webstart/ui/UIMessages"; + public static final String PASSWD_FILE = ".secret"; + /** resource bundle messages */ + public static final String GREETING_CAPTION = "Greetings.Caption"; + public static final String GREETING_MESSAGE = "Greetings.Message"; + public static final String VERSION_FILE = ".version"; private static Log log = LogFactory.getLog(BKULauncher.class); - private ResourceBundle resourceBundle = null; private Container server; -// private SplashScreen splash = SplashScreen.getSplashScreen(); + private void createConfig(File configDir, File versionFile, String version) throws IOException, CertificateException, GeneralSecurityException, KeyStoreException, FileNotFoundException, NoSuchAlgorithmException { + log.debug("creating config directory: " + configDir); + configDir.mkdirs(); + InputStream is = getClass().getClassLoader().getResourceAsStream(CONF_TEMPLATE_RESOURCE); + OutputStream os = new FileOutputStream(new File(configDir, CONF_TEMPLATE_FILE)); + StreamUtil.copyStream(is, os); + os.close(); + File confTemplateFile = new File(configDir, CONF_TEMPLATE_FILE); + unzip(confTemplateFile); + confTemplateFile.delete(); + writeVersionFile(versionFile, version); + } + + private void createCertificates(File configDir) throws IOException, GeneralSecurityException, CodingException { + char[] password = UUID.randomUUID().toString().toCharArray(); + File passwdFile = new File(configDir, PASSWD_FILE); + FileWriter passwdWriter = new FileWriter(passwdFile); + passwdWriter.write(password); + passwdWriter.close(); + if (!passwdFile.setReadable(true, true)) { + passwdFile.delete(); + throw new IOException("failed to make " + passwdFile + " owner readable only, deleting file"); + } + TLSServerCA ca = new TLSServerCA(); + KeyStore ks = ca.generateKeyStore(password); + FileOutputStream fos = new FileOutputStream(new File(configDir, KEYSTORE_FILE)); + ks.store(fos, password); + fos.close(); + } + + private String getFileVersion(File versionFile) throws FileNotFoundException, IOException { + //TODO no file? + if (versionFile.exists() && versionFile.canRead()) { + BufferedReader versionReader = new BufferedReader(new FileReader(versionFile)); + String versionString = null; + while ((versionString = versionReader.readLine().trim()) != null) { + if (versionString.length() > 0 && !versionString.startsWith("#")) { + log.debug("found existing configuration version " + versionString); + break; + } + } + return versionString; + } + return null; + } + + private String getManifestVersion() throws MalformedURLException, IOException { + String bkuWebStartJar = BKULauncher.class.getProtectionDomain().getCodeSource().getLocation().toString(); + URL manifestURL = new URL("jar:" + bkuWebStartJar + "!/META-INF/MANIFEST.MF"); + String version = null; + if (manifestURL != null) { + Manifest manifest = new Manifest(manifestURL.openStream()); + if (log.isTraceEnabled()) { + log.trace("read version information from " + manifestURL); + } + Attributes atts = manifest.getMainAttributes(); + if (atts != null) { + version = atts.getValue("Implementation-Build"); + } + } + if (version == null) { + version = "UNKNOWN"; + } + log.debug("config version: " + version); + return version; + } + + /** + * change the + * @param oldVersion + * @param newVersion + * @return + */ + private boolean updateRequired(String oldVersion, String newVersion) { + if (oldVersion != null) { + int majorEnd = oldVersion.indexOf('-'); + if (majorEnd > 0) { + oldVersion = oldVersion.substring(0, majorEnd); + } + return (oldVersion.compareTo(MIN_CONFIG_VERSION) < 0); + } + log.debug("no old version, update required"); + return true; + } + + private boolean updateRequiredStrict(String oldVersion, String newVersion) { + String[] oldV = oldVersion.split("-"); + String[] newV = newVersion.split("-"); + log.debug("comparing " + oldV[0] + " to " + newV[0]); + if (oldV[0].compareTo(newV[0]) < 0) { + log.debug("update required"); + return true; + } else { + log.debug("comparing " + oldV[oldV.length - 1] + " to " + newV[newV.length - 1]); + if (oldV[oldV.length - 1].compareTo(newV[newV.length - 1]) < 0) { + log.debug("update required"); + return true; + } else { + log.debug("no update required"); + return false; + } + } + } + + private void writeVersionFile(File versionFile, String version) throws IOException { + BufferedWriter versionWriter = new BufferedWriter(new FileWriter(versionFile)); + versionWriter.write("# MOCCA Web Start configuration version\n"); + versionWriter.write("# DO NOT MODIFY THIS FILE\n\n"); + versionWriter.write(version); + versionWriter.close(); + } + +// private SplashScreen splash = SplashScreen.getSplashScreen(); private void startUpServer() throws Exception { + log.info("init servlet container and MOCCA webapp"); server = new Container(); // XmlConfiguration xcfg = new XmlConfiguration(getClass().getClassLoader() // .getResourceAsStream("at/gv/egiz/bku/local/app/jetty.xml")); @@ -44,25 +193,24 @@ public class BKULauncher implements BKUControllerInterface { } private void initTrayIcon() { + log.debug("init MOCCA tray icon"); Locale loc = Locale.getDefault(); try { resourceBundle = ResourceBundle.getBundle( - "at/gv/egiz/bku/webstart/ui/UIMessages", loc); + MESSAGES_RESOURCE, loc); } catch (MissingResourceException mx) { resourceBundle = ResourceBundle.getBundle( - "at/gv/egiz/bku/webstart/ui/UIMessages", Locale.ENGLISH); + MESSAGES_RESOURCE, Locale.ENGLISH); } TrayIconDialog.getInstance().init(resourceBundle); TrayIconDialog.getInstance().setShutdownHook(this); - TrayIconDialog.getInstance().displayInfo("Greetings.Caption", - "Greetings.Message"); + TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); } private void initStart() { - } - private void initFinished() { + private void initFinished(boolean installCert) { try { // if (splash != null) { // try { @@ -71,34 +219,33 @@ public class BKULauncher implements BKUControllerInterface { // log.warn("Failed to close splash screen: " + ex.getMessage()); // } // } + + log.debug("trying install MOCCA certificate on system browser"); + if (installCert) { + if (Desktop.isDesktopSupported()) { + Desktop desktop = Desktop.getDesktop(); + if (desktop.isSupported(Desktop.Action.BROWSE)) { + try { + desktop.browse(new URI("https://localhost:" + + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue())); + } catch (Exception ex) { + log.error("failed to open system browser, install MOCCA certificate manually", ex); + } + } else { + log.error("failed to open system browser, install MOCCA certificate manually"); + } + } else { + log.error("failed to open system browser, install MOCCA certificate manually"); + } + } + + log.info("init completed, joining server"); server.join(); } catch (InterruptedException e) { - log.info(e); + log.warn("failed to join MOCCA server: " + e.getMessage(), e); } } -// private void copyDirs(File srcDir, File dstDir) { -// for (File cf : srcDir.listFiles()) { -// File of = new File(dstDir, cf.getName()); -// if (cf.isDirectory()) { -// log.debug("Creating directory: " + of); -// of.mkdir(); -// copyDirs(cf, of); -// } else { -// log.debug("Writing file: " + of); -// try { -// FileInputStream fis = new FileInputStream(cf); -// FileOutputStream fos = new FileOutputStream(of); -// StreamUtil.copyStream(fis, fos); -// fis.close(); -// fos.close(); -// } catch (IOException e) { -// log.error("Cannot copy default configuration", e); -// } -// } -// } -// } - private void unzip(File zipfile) throws IOException { File dir = zipfile.getParentFile(); ZipFile zipFile = new ZipFile(zipfile); @@ -113,73 +260,11 @@ public class BKULauncher implements BKUControllerInterface { File f = new File(eF.getParent()); f.mkdirs(); StreamUtil.copyStream(zipFile.getInputStream(entry), - new FileOutputStream(eF)); + new FileOutputStream(eF)); } zipFile.close(); } - private void checkConfig(String[] args) { -// CommandLineParser parser = new PosixParser(); -// Options options = new Options(); -// options.addOption("c", true, "the configuration's base directory"); -// options.addOption("h", false, "print this message"); -// try { - File cfgDir = new File(System.getProperty("user.home") + "/.mocca/conf"); -// CommandLine cmd = parser.parse(options, args); -// if (cmd.hasOption("h")) { -// HelpFormatter formatter = new HelpFormatter(); -// formatter.printHelp("BKULauncher", options); -// System.exit(0); -// } -// -// if (cmd.hasOption("c")) { -// cfgDir = new File(cmd.getOptionValue("c")); -// } - log.debug("using config directory: " + cfgDir); - if (cfgDir.exists() && cfgDir.isFile()) { - log.error("Configuration directory must not be a file"); - } - if (!cfgDir.exists()) { - log.debug("Creating config directory: " + cfgDir); - cfgDir.mkdirs(); - try { - InputStream is = getClass().getClassLoader().getResourceAsStream( - "at/gv/egiz/bku/webstart/defaultConf/template.zip"); - OutputStream os = new FileOutputStream(new File(cfgDir, - "template.zip")); - StreamUtil.copyStream(is, os); - os.close(); - unzip(new File(cfgDir, "template.zip")); - } catch (IOException iox) { - log.error("Cannot create user directory", iox); - return; - } - CA ca = new CA(); - char[] password = "changeMe".toCharArray(); - KeyStore ks = ca.generateKeyStore(password); - if (ks != null) { - File ksdir = new File(cfgDir, "keystore"); - ksdir.mkdirs(); - FileOutputStream fos; - try { - fos = new FileOutputStream(new File(ksdir, "keystore.ks")); - ks.store(fos, password); - fos.close(); - } catch (Exception e) { - log.error("Cannot store keystore", e); - } - } else { - log.error("Cannot create ssl certificate"); - } - } -// } catch (ParseException e1) { -// log.error(e1); -// HelpFormatter formatter = new HelpFormatter(); -// formatter.printHelp("BKULauncher", options); -// System.exit(0); -// } - } - /** * @param args */ @@ -189,15 +274,74 @@ public class BKULauncher implements BKUControllerInterface { System.setSecurityManager(null); BKULauncher launcher = new BKULauncher(); launcher.initStart(); - launcher.checkConfig(args); + + File configDir = new File(System.getProperty("user.home") + '/' + CONFIG_DIR); + boolean installCert = launcher.ensureConfig(configDir); launcher.startUpServer(); launcher.initTrayIcon(); - launcher.initFinished(); + launcher.initFinished(installCert); } catch (Exception e) { - log.fatal("Cannot launch BKU", e); + log.fatal("Failed to launch BKU: " + e.getMessage(), e); System.exit(-1000); } + } + + private void backupAndDelete(File dir, URI relativeTo, ZipOutputStream zip) throws IOException { + if (dir.isDirectory()) { + File[] subDirs = dir.listFiles(); + for (File subDir : subDirs) { + backupAndDelete(subDir, relativeTo, zip); + subDir.delete(); + } + } else { + URI relativePath = relativeTo.relativize(dir.toURI()); + ZipEntry entry = new ZipEntry(relativePath.toString()); + zip.putNextEntry(entry); + BufferedInputStream entryIS = new BufferedInputStream(new FileInputStream(dir)); + StreamUtil.copyStream(entryIS, zip); + entryIS.close(); + zip.closeEntry(); + dir.delete(); + } + } + /** + * Checks whether the config directory already exists and creates it otherwise. + * @param configDir the config directory to be created + * @return true if a new MOCCA cert was created (and needs to be installed in the browser) + */ + private boolean ensureConfig(File configDir) throws IOException, GeneralSecurityException, CodingException { + log.debug("config directory: " + configDir); + String manifestVersion = getManifestVersion(); + File versionFile = new File(configDir, VERSION_FILE); + + if (configDir.exists()) { + if (configDir.isFile()) { + log.error("invalid config directory: " + configDir); + throw new IOException("invalid config directory: " + configDir); + } else { + String fileVersion = getFileVersion(versionFile); + if (updateRequired(fileVersion, manifestVersion)) { + if (fileVersion == null) { + fileVersion = "unknown"; + } + log.info("updating configuration from " + fileVersion + " to " + manifestVersion); + File moccaDir = configDir.getParentFile(); + File zipFile = new File(moccaDir, "conf-" + fileVersion + ".zip"); + ZipOutputStream zipOS = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile))); + backupAndDelete(configDir, moccaDir.toURI(), zipOS); + zipOS.close(); + createConfig(configDir, versionFile, manifestVersion); + createCertificates(configDir); + return true; + } + } + } else { + createConfig(configDir, versionFile, manifestVersion); + createCertificates(configDir); + return true; + } + return false; } public void shutDown() { @@ -217,5 +361,4 @@ public class BKULauncher implements BKUControllerInterface { } System.exit(0); } - } diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java deleted file mode 100644 index f81d3d83..00000000 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/CA.java +++ /dev/null @@ -1,117 +0,0 @@ -package at.gv.egiz.bku.webstart; - -import iaik.asn1.ObjectID; -import iaik.asn1.structures.AlgorithmID; -import iaik.asn1.structures.Name; -import iaik.x509.X509Certificate; -import iaik.x509.extensions.BasicConstraints; -import iaik.x509.extensions.KeyUsage; - -import java.math.BigInteger; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.security.GeneralSecurityException; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.KeyStore; -import java.security.NoSuchAlgorithmException; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.Random; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -public class CA { - private final static Log log = LogFactory.getLog(CA.class); - - private KeyPair caKeyPair; - private X509Certificate caCert; - - private KeyPair serverKeyPair; - private X509Certificate serverCert; - - public CA() { - } - - private KeyPair generateKeyPair() throws NoSuchAlgorithmException { - KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA"); - gen.initialize(2048); - return gen.generateKeyPair(); - } - - private void generateCA() throws GeneralSecurityException { - log.debug("Generating CA certificate"); - Name subject = new Name(); - subject.addRDN(ObjectID.country, "AT"); - subject.addRDN(ObjectID.organization, "MOCCA"); - subject.addRDN(ObjectID.organizationalUnit, "MOCCA-CA"); - - caKeyPair = generateKeyPair(); - caCert = new X509Certificate(); - caCert.setSerialNumber(new BigInteger(20, new Random())); - caCert.setSubjectDN(subject); - caCert.setPublicKey(caKeyPair.getPublic()); - caCert.setIssuerDN(subject); - - caCert.addExtension(new BasicConstraints(true)); - caCert.addExtension(new KeyUsage(KeyUsage.keyCertSign | KeyUsage.cRLSign - | KeyUsage.digitalSignature)); - - GregorianCalendar date = new GregorianCalendar(); - date.add(Calendar.HOUR_OF_DAY, -1); - caCert.setValidNotBefore(date.getTime()); - date.add(Calendar.YEAR, 7); - caCert.setValidNotAfter(date.getTime()); - caCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate()); - log.debug("Successfully signed CA certificate"); - } - - private void generateServerCert() throws GeneralSecurityException { - log.debug("Generating SSL certificate"); - Name subject = new Name(); - subject.addRDN(ObjectID.country, "AT"); - subject.addRDN(ObjectID.organization, "MOCCA"); - try { - subject.addRDN(ObjectID.commonName, InetAddress.getLocalHost() - .getHostName()); - } catch (UnknownHostException e) { - subject.addRDN(ObjectID.commonName, "localhost"); - } - serverKeyPair = generateKeyPair(); - serverCert = new X509Certificate(); - serverCert.setSerialNumber(new BigInteger(20, new Random())); - serverCert.setSubjectDN(subject); - serverCert.setPublicKey(serverKeyPair.getPublic()); - serverCert.setIssuerDN(caCert.getSubjectDN()); - - serverCert.addExtension(new BasicConstraints(false)); - serverCert.addExtension(new KeyUsage(KeyUsage.keyEncipherment - | KeyUsage.digitalSignature)); - - GregorianCalendar date = new GregorianCalendar(); - date.add(Calendar.HOUR_OF_DAY, -1); - serverCert.setValidNotBefore(date.getTime()); - date.add(Calendar.YEAR, 7); - date.add(Calendar.HOUR_OF_DAY, -1); - serverCert.setValidNotAfter(date.getTime()); - serverCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate()); - log.debug("Successfully signed server certificate"); - caKeyPair = null; - } - - public KeyStore generateKeyStore(char[] password) { - try { - generateCA(); - generateServerCert(); - KeyStore ks = KeyStore.getInstance("JKS"); - ks.load(null, null); - ks.setKeyEntry("server", serverKeyPair.getPrivate(), password, new X509Certificate[]{serverCert, caCert}); - return ks; - } catch (Exception e) { - log.error("Cannot generate certificate", e); - } - return null; - } - -} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index ef12e4fd..0cd3e633 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -1,5 +1,15 @@ package at.gv.egiz.bku.webstart; +import at.gv.egiz.bku.utils.StreamUtil; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mortbay.jetty.Connector; @@ -14,8 +24,8 @@ import org.mortbay.thread.QueuedThreadPool; public class Container { - public static final String HTTP_PORT = "mocca.http.port"; - public static final String HTTPS_PORT = "mocca.http.port"; + public static final String HTTP_PORT_PROPERTY = "mocca.http.port"; + public static final String HTTPS_PORT_PROPERTY = "mocca.http.port"; private static Log log = LogFactory.getLog(Container.class); @@ -24,7 +34,7 @@ public class Container { public Container() { } - public void init() { + public void init() throws IOException { server = new Server(); QueuedThreadPool qtp = new QueuedThreadPool(); qtp.setMaxThreads(5); @@ -35,35 +45,51 @@ public class Container { server.setGracefulShutdown(3000); SelectChannelConnector connector = new SelectChannelConnector(); - connector.setPort(Integer.getInteger(HTTP_PORT, 3495).intValue()); + connector.setPort(Integer.getInteger(HTTP_PORT_PROPERTY, 3495).intValue()); connector.setAcceptors(1); - connector.setConfidentialPort(Integer.getInteger(HTTPS_PORT, 3496).intValue()); + connector.setConfidentialPort(Integer.getInteger(HTTPS_PORT_PROPERTY, 3496).intValue()); + connector.setHost("127.0.0.1"); SslSocketConnector sslConnector = new SslSocketConnector(); - sslConnector.setPort(Integer.getInteger(HTTPS_PORT, 3496).intValue()); + sslConnector.setPort(Integer.getInteger(HTTPS_PORT_PROPERTY, 3496).intValue()); sslConnector.setAcceptors(1); - sslConnector.setKeystore(System.getProperty("user.home") - + "/.mocca/conf/keystore/keystore.ks"); - sslConnector.setPassword("changeMe"); - sslConnector.setKeyPassword("changeMe"); + sslConnector.setHost("127.0.0.1"); + File configDir = new File(System.getProperty("user.home") + "/" + BKULauncher.CONFIG_DIR); + sslConnector.setKeystore(configDir.getPath() + "/" + BKULauncher.KEYSTORE_FILE); + File passwdFile = new File(configDir, BKULauncher.PASSWD_FILE); + BufferedReader reader = new BufferedReader(new FileReader(passwdFile)); + String pwd; + while ((pwd = reader.readLine()) != null) { + sslConnector.setPassword(pwd); + sslConnector.setKeyPassword(pwd); + } + reader.close(); server.setConnectors(new Connector[] { connector, sslConnector }); -// HandlerCollection handlers = new HandlerCollection(); WebAppContext webapp = new WebAppContext(); + webapp.setLogUrlOnStart(true); webapp.setContextPath("/"); - webapp.setExtractWAR(true); //false - webapp.setParentLoaderPriority(false); + webapp.setExtractWAR(true); + webapp.setParentLoaderPriority(false); //true); -// webappcontext.setWar("BKULocal-1.0.4-SNAPSHOT.war"); - webapp.setWar(getClass().getClassLoader().getResource("BKULocalWar/").toString()); - -// handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() }); + webapp.setWar(copyWebapp(webapp.getTempDirectory())); //getClass().getClassLoader().getResource("BKULocalWar/").toString()); server.setHandler(webapp); server.setGracefulShutdown(1000*3); } + + private String copyWebapp(File webappDir) throws IOException { + File webapp = new File(webappDir, "BKULocal.war"); + log.debug("copying BKULocal classpath resource to " + webapp); + InputStream is = getClass().getClassLoader().getResourceAsStream("BKULocal.war"); + OutputStream os = new BufferedOutputStream(new FileOutputStream(webapp)); + StreamUtil.copyStream(is, os); + os.close(); + return webapp.getPath(); + } + public void start() throws Exception { server.start(); } diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java new file mode 100644 index 00000000..97ca716b --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java @@ -0,0 +1,138 @@ +package at.gv.egiz.bku.webstart; + +import iaik.asn1.CodingException; +import iaik.asn1.ObjectID; +import iaik.asn1.structures.AlgorithmID; +import iaik.asn1.structures.GeneralName; +import iaik.asn1.structures.GeneralNames; +import iaik.asn1.structures.Name; +import iaik.x509.X509Certificate; +import iaik.x509.extensions.AuthorityKeyIdentifier; +import iaik.x509.extensions.BasicConstraints; +import iaik.x509.extensions.ExtendedKeyUsage; +import iaik.x509.extensions.KeyUsage; + +import iaik.x509.extensions.SubjectAltName; +import iaik.x509.extensions.SubjectKeyIdentifier; +import java.io.IOException; +import java.math.BigInteger; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.security.GeneralSecurityException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.Random; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class TLSServerCA { + public static final int CA_VALIDITY_Y = 3; + public static final int SERVER_VALIDITY_Y = 3; + private final static Log log = LogFactory.getLog(TLSServerCA.class); + + private KeyPair caKeyPair; + private X509Certificate caCert; + + private KeyPair serverKeyPair; + private X509Certificate serverCert; + + private KeyPair generateKeyPair() throws NoSuchAlgorithmException { + KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA"); + gen.initialize(2048); + return gen.generateKeyPair(); + } + + private void generateCACert() throws GeneralSecurityException, CodingException { + log.debug("generating MOCCA CA certificate"); + Name subject = new Name(); + subject.addRDN(ObjectID.country, "AT"); + subject.addRDN(ObjectID.organization, "MOCCA"); + subject.addRDN(ObjectID.organizationalUnit, "MOCCA TLS Server CA"); + + caKeyPair = generateKeyPair(); + caCert = new X509Certificate(); + caCert.setSerialNumber(new BigInteger(20, new Random())); + caCert.setSubjectDN(subject); + caCert.setPublicKey(caKeyPair.getPublic()); + caCert.setIssuerDN(subject); + + caCert.addExtension(new SubjectKeyIdentifier(caKeyPair.getPublic())); + + caCert.addExtension(new BasicConstraints(true)); + caCert.addExtension(new KeyUsage(KeyUsage.keyCertSign | KeyUsage.cRLSign + | KeyUsage.digitalSignature)); + + GregorianCalendar date = new GregorianCalendar(); + date.add(Calendar.HOUR_OF_DAY, -1); + caCert.setValidNotBefore(date.getTime()); + date.add(Calendar.YEAR, CA_VALIDITY_Y); + caCert.setValidNotAfter(date.getTime()); + caCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate()); + + log.debug("successfully generated MOCCA TLS Server CA certificate " + caCert.getSubjectDN()); + } + + private void generateServerCert() throws GeneralSecurityException, CodingException { + log.debug("generating MOCCA server certificate"); + Name subject = new Name(); + subject.addRDN(ObjectID.country, "AT"); + subject.addRDN(ObjectID.organization, "MOCCA"); + subject.addRDN(ObjectID.organizationalUnit, "MOCCA TLS Server"); + subject.addRDN(ObjectID.commonName, "localhost"); + subject.addRDN(ObjectID.commonName, "127.0.0.1"); + + serverKeyPair = generateKeyPair(); + serverCert = new X509Certificate(); + serverCert.setSerialNumber(new BigInteger(20, new Random())); + serverCert.setSubjectDN(subject); + serverCert.setPublicKey(serverKeyPair.getPublic()); + serverCert.setIssuerDN(caCert.getSubjectDN()); + + serverCert.addExtension(new SubjectKeyIdentifier(serverKeyPair.getPublic())); + byte[] aki = new SubjectKeyIdentifier(caCert.getPublicKey()).get(); + serverCert.addExtension(new AuthorityKeyIdentifier(aki)); + + serverCert.addExtension(new ExtendedKeyUsage(ExtendedKeyUsage.serverAuth)); + + GeneralNames altNames = new GeneralNames(); + altNames.addName(new GeneralName(GeneralName.dNSName, "localhost")); + altNames.addName(new GeneralName(GeneralName.dNSName, "127.0.0.1")); + altNames.addName(new GeneralName(GeneralName.iPAddress, "127.0.0.1")); + serverCert.addExtension(new SubjectAltName(altNames)); + + serverCert.addExtension(new BasicConstraints(false)); + serverCert.addExtension(new KeyUsage(KeyUsage.keyEncipherment + | KeyUsage.digitalSignature)); + + GregorianCalendar date = new GregorianCalendar(); + date.add(Calendar.HOUR_OF_DAY, -1); + serverCert.setValidNotBefore(date.getTime()); + date.add(Calendar.YEAR,SERVER_VALIDITY_Y); + date.add(Calendar.HOUR_OF_DAY, -1); + serverCert.setValidNotAfter(date.getTime()); + serverCert.sign(AlgorithmID.sha1WithRSAEncryption, caKeyPair.getPrivate()); + + log.debug("successfully generated MOCCA TLS Server certificate " + serverCert.getSubjectDN()); + caKeyPair = null; + } + + public KeyStore generateKeyStore(char[] password) throws GeneralSecurityException, IOException, CodingException { +// try { + generateCACert(); + generateServerCert(); + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(null, null); + ks.setKeyEntry("server", serverKeyPair.getPrivate(), password, new X509Certificate[]{serverCert, caCert}); + return ks; +// } catch (Exception e) { +// log.error("Cannot generate certificate", e); +// } +// return null; + } + +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java index 4679eac5..9990b2a0 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java @@ -36,6 +36,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class TrayIconDialog implements TrayIconDialogInterface { + public static final String TRAYICON_RESOURCE = "at/gv/egiz/bku/webstart/ui/trayicon.png"; + public static final String TRAYMENU_SHUTDOWN = "TrayMenu.Shutdown"; + public static final String TRAYMENU_TOOLTIP = "TrayMenu.Tooltip"; private static Log log = LogFactory.getLog(TrayIconDialog.class); private static TrayIconDialogInterface instance; @@ -107,10 +110,10 @@ public class TrayIconDialog implements TrayIconDialogInterface { if (isSupported) { SystemTray tray = SystemTray.getSystemTray(); Image image = ImageIO.read(getClass().getClassLoader() - .getResourceAsStream("at/gv/egiz/bku/webstart/ui/logo.png")); + .getResourceAsStream(TRAYICON_RESOURCE)); PopupMenu popup = new PopupMenu(); MenuItem exitItem = new MenuItem(resourceBundel - .getString("TrayMenu.Shutdown")); + .getString(TRAYMENU_SHUTDOWN)); popup.add(exitItem); exitItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -123,7 +126,7 @@ public class TrayIconDialog implements TrayIconDialogInterface { trayIcon = new TrayIcon(image, "BKULogo", popup); trayIcon.setImageAutoSize(true); - trayIcon.setToolTip(resourceBundel.getString("TrayMenu.Tooltip")); + trayIcon.setToolTip(resourceBundel.getString(TRAYMENU_TOOLTIP)); try { tray.add(trayIcon); } catch (AWTException e) { diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo.png b/BKUWebStart/src/main/jnlp/resources/img/logo.png new file mode 100644 index 00000000..2c622d88 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png b/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png new file mode 100644 index 00000000..fa6d7f96 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png b/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png new file mode 100644 index 00000000..d7f8bbd0 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/splash.png b/BKUWebStart/src/main/jnlp/resources/img/splash.png new file mode 100644 index 00000000..72c1d868 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/splash.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/version.xml b/BKUWebStart/src/main/jnlp/resources/img/version.xml new file mode 100644 index 00000000..715b6722 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/img/version.xml @@ -0,0 +1,17 @@ + + + + + logo.png + 1.0-SNAPSHOT + + logo.png + + + + splash.png + 1.0-SNAPSHOT + + splash.png + + diff --git a/BKUWebStart/src/main/jnlp/resources/logo.png b/BKUWebStart/src/main/jnlp/resources/logo.png deleted file mode 100644 index 2c622d88..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/logo.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/logo_64x64.png b/BKUWebStart/src/main/jnlp/resources/logo_64x64.png deleted file mode 100644 index fa6d7f96..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/logo_64x64.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/logo_90x90.png b/BKUWebStart/src/main/jnlp/resources/logo_90x90.png deleted file mode 100644 index d7f8bbd0..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/logo_90x90.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/splash.png b/BKUWebStart/src/main/jnlp/resources/splash.png deleted file mode 100644 index 72c1d868..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/splash.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml new file mode 100644 index 00000000..a5b10b47 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -0,0 +1,186 @@ + + + + + BKUWebStart-1.0.3-SNAPSHOT.jar + 1.0.3-SNAPSHOT + + BKUWebStart-1.0.3-SNAPSHOT.jar + + + + + commons-logging-1.0.4.jar + 1.0.4 + + commons-logging-1.0.4.jar + + + + + + activation-1.1.jar + 1.1 + + activation-1.1.jar + + + + + log4j-1.2.12.jar + 1.2.12 + + log4j-1.2.12.jar + + + + + iaik_ecc_signed-2.15.jar + 2.15 + + iaik_ecc_signed-2.15.jar + + + + iaik_jce_full_signed-3.16.jar + 3.16 + + iaik_jce_full_signed-3.16.jar + + + + iaik_xsect-1.14.jar + 1.14 + + iaik_xsect-1.14.jar + + + + + + jetty-6.1.15.jar + 6.1.15 + + jetty-6.1.15.jar + + + + jetty-util-6.1.15.jar + 6.1.15 + + jetty-util-6.1.15.jar + + + + servlet-api-2.5-20081211.jar + 2.5-20081211 + + servlet-api-2.5-20081211.jar + + + + + jaxb-api-2.1.jar + 2.1 + + jaxb-api-2.1.jar + + + + jaxb-impl-2.1.9.jar + 2.1.9 + + jaxb-impl-2.1.9.jar + + + + stax-api-1.0-2.jar + 1.0-2 + + stax-api-1.0-2.jar + + + + + + utils-1.1.2-SNAPSHOT.jar + 1.1.2-SNAPSHOT + + utils-1.1.2-SNAPSHOT.jar + + + + diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 0a89a036..a355da77 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -1,15 +1,20 @@ - + + + $project.Name $project.Organization.Name $project.Description - - + $project.Description + + - + #if($offlineAllowed) diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png deleted file mode 100644 index 598ab00b..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/logo.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png new file mode 100644 index 00000000..2c622d88 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png differ diff --git a/BKUWebStart/src/main/resources/logo.png b/BKUWebStart/src/main/resources/logo.png deleted file mode 100644 index fa6d7f96..00000000 Binary files a/BKUWebStart/src/main/resources/logo.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/splash.png b/BKUWebStart/src/main/resources/splash.png deleted file mode 100644 index 72c1d868..00000000 Binary files a/BKUWebStart/src/main/resources/splash.png and /dev/null differ -- cgit v1.2.3 From 5a45508c63ad07606fa39ac8c773d46ada353acf Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 16 Jun 2009 16:25:17 +0000 Subject: tray icon on startup, messages git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@364 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- .../java/at/gv/egiz/bku/webstart/BKULauncher.java | 10 ++- BKUWebStart/src/main/jnlp/resources/version.xml | 77 ---------------------- BKUWebStart/src/main/jnlp/template.xml | 6 +- BKUWebStart/src/main/jnlp/template_dev.xml | 39 +++++++++++ .../gv/egiz/bku/webstart/ui/UIMessages.properties | 10 +-- 6 files changed, 57 insertions(+), 87 deletions(-) create mode 100644 BKUWebStart/src/main/jnlp/template_dev.xml (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index ec5fd976..25683dba 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -15,7 +15,7 @@ |--> 1.0.3-SNAPSHOT http://mocca.egovlabs.gv.at/ - Web Start Bürgerkartenumgebung (MOCCA-lokal) + Bürgerkartenumgebung (MOCCA Web Start) diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java index 3d09fb00..b1fc29be 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -64,6 +64,8 @@ public class BKULauncher implements BKUControllerInterface { /** resource bundle messages */ public static final String GREETING_CAPTION = "Greetings.Caption"; public static final String GREETING_MESSAGE = "Greetings.Message"; + public static final String STARTUP_CAPTION = "Startup.Caption"; + public static final String STARTUP_MESSAGE = "Startup.Message"; public static final String VERSION_FILE = ".version"; private static Log log = LogFactory.getLog(BKULauncher.class); private ResourceBundle resourceBundle = null; @@ -204,7 +206,7 @@ public class BKULauncher implements BKUControllerInterface { } TrayIconDialog.getInstance().init(resourceBundle); TrayIconDialog.getInstance().setShutdownHook(this); - TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); +// TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); } private void initStart() { @@ -277,8 +279,12 @@ public class BKULauncher implements BKUControllerInterface { File configDir = new File(System.getProperty("user.home") + '/' + CONFIG_DIR); boolean installCert = launcher.ensureConfig(configDir); - launcher.startUpServer(); launcher.initTrayIcon(); + TrayIconDialog.getInstance().displayInfo(STARTUP_CAPTION, STARTUP_MESSAGE); + launcher.startUpServer(); + TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); + +// launcher.initTrayIcon(); launcher.initFinished(installCert); } catch (Exception e) { log.fatal("Failed to launch BKU: " + e.getMessage(), e); diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index a5b10b47..197c05b5 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -15,27 +15,6 @@ commons-logging-1.0.4.jar - @@ -74,13 +53,6 @@ iaik_xsect-1.14.jar - @@ -125,34 +97,6 @@ stax-api-1.0-2.jar - @@ -161,26 +105,5 @@ utils-1.1.2-SNAPSHOT.jar - diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index a355da77..07e1c28a 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -5,11 +5,11 @@ - $project.Name + $project.Name EarlyAccess $project.Organization.Name - $project.Description - $project.Description + $project.Description EarlyAccess + $project.Description EarlyAccess diff --git a/BKUWebStart/src/main/jnlp/template_dev.xml b/BKUWebStart/src/main/jnlp/template_dev.xml new file mode 100644 index 00000000..2d8e8133 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/template_dev.xml @@ -0,0 +1,39 @@ + + + + + $project.Name + $project.Organization.Name + + $project.Description + $project.Description + + + + + + + +#if($offlineAllowed) + +#end + + + + +#if($allPermissions) + + + +#end + + + + + + + $dependencies + + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties index 873d03ef..6ee1a510 100644 --- a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties +++ b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties @@ -1,9 +1,11 @@ #-------- tray icon messages ------- -TrayMenu.Tooltip=MOCCA -TrayMenu.Shutdown=MOCCA Beenden +TrayMenu.Tooltip=B\u00FCrgerkartenumgebung (MOCCA Web Start) +TrayMenu.Shutdown=B\u00FCrgerkartenumgebung beenden -Greetings.Message=MOCCA up and running -Greetings.Caption=MOCCA Started +Startup.Message=B\u00FCrgerkartenumgebung wird gestartet... +Startup.Caption=B\u00FCrgerkartenumgebung (MOCCA Web Start) +Greetings.Message=B\u00FCrgerkartenumgebung erfolgreich gestartet +Greetings.Caption=B\u00FCrgerkartenumgebung (MOCCA Web Start) Message.RequestCaption=New Request Message.InfoboxReadRequest=Reading Infobox -- cgit v1.2.3 From 69e0dbee3567fc3a710d7bffad4d03e64edd7daa Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 25 Jun 2009 12:07:39 +0000 Subject: TLS CipherSuites (FF XP) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@375 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 ++ .../java/at/gv/egiz/bku/webstart/BKULauncher.java | 68 +++++++++++++++++----- .../java/at/gv/egiz/bku/webstart/Container.java | 47 ++++++++++++++- BKUWebStart/src/main/jnlp/resources/player.jnlp | 3 + BKUWebStart/src/main/jnlp/template.xml | 7 ++- .../gv/egiz/bku/webstart/ui/UIMessages.properties | 5 +- 6 files changed, 116 insertions(+), 20 deletions(-) create mode 100644 BKUWebStart/src/main/jnlp/resources/player.jnlp (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 25683dba..fb72f26f 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -205,6 +205,12 @@ utils at.gv.egiz 1.1.2-SNAPSHOT + + + iaik_ecc_signed + iaik + + commons-logging diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java index b1fc29be..36c9cbb2 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -41,6 +41,7 @@ import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.FileReader; import java.io.FileWriter; +import java.net.BindException; import java.net.URI; import java.net.URL; import java.security.GeneralSecurityException; @@ -48,6 +49,7 @@ import java.util.UUID; import java.util.jar.Attributes; import java.util.jar.Manifest; import java.util.zip.ZipOutputStream; +import org.mortbay.util.MultiException; public class BKULauncher implements BKUControllerInterface { @@ -65,7 +67,11 @@ public class BKULauncher implements BKUControllerInterface { public static final String GREETING_CAPTION = "Greetings.Caption"; public static final String GREETING_MESSAGE = "Greetings.Message"; public static final String STARTUP_CAPTION = "Startup.Caption"; + public static final String ERROR_CAPTION = "Error.Caption"; public static final String STARTUP_MESSAGE = "Startup.Message"; + public static final String ERROR_STARTUP_MESSAGE = "Error.Startup.Message"; + public static final String ERROR_CONF_MESSAGE = "Error.Conf.Message"; + public static final String ERROR_BIND_MESSAGE = "Error.Bind.Message"; public static final String VERSION_FILE = ".version"; private static Log log = LogFactory.getLog(BKULauncher.class); private ResourceBundle resourceBundle = null; @@ -222,8 +228,8 @@ public class BKULauncher implements BKUControllerInterface { // } // } - log.debug("trying install MOCCA certificate on system browser"); if (installCert) { + log.debug("trying install MOCCA certificate on system browser"); if (Desktop.isDesktopSupported()) { Desktop desktop = Desktop.getDesktop(); if (desktop.isSupported(Desktop.Action.BROWSE)) { @@ -270,26 +276,60 @@ public class BKULauncher implements BKUControllerInterface { /** * @param args */ - public static void main(String[] args) { - try { - log.warn("***** DISABLING SECURITY MANAGER *******"); + public static void main(String[] args) throws InterruptedException { + + if (log.isDebugEnabled()) { + //System.setProperty("DEBUG", "true"); + System.setProperty("VERBOSE", "true"); + System.setProperty("javax.net.debug", "ssl,handshake"); + } + +// log.warn("***** DISABLING SECURITY MANAGER *******"); System.setSecurityManager(null); + BKULauncher launcher = new BKULauncher(); launcher.initStart(); - File configDir = new File(System.getProperty("user.home") + '/' + CONFIG_DIR); - boolean installCert = launcher.ensureConfig(configDir); + boolean installCert = false; + launcher.initTrayIcon(); TrayIconDialog.getInstance().displayInfo(STARTUP_CAPTION, STARTUP_MESSAGE); - launcher.startUpServer(); - TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); -// launcher.initTrayIcon(); - launcher.initFinished(installCert); - } catch (Exception e) { - log.fatal("Failed to launch BKU: " + e.getMessage(), e); - System.exit(-1000); - } + try { + File configDir = new File(System.getProperty("user.home") + '/' + CONFIG_DIR); + installCert = launcher.ensureConfig(configDir); + } catch (Exception ex) { + log.fatal("Failed to init MOCCA configuration, exiting", ex); + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_CONF_MESSAGE); + Thread.sleep(5000); + System.exit(-1000); + } + + try { + launcher.startUpServer(); + TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); + launcher.initFinished(installCert); + } catch (BindException ex) { + log.fatal("Failed to launch MOCCA, " + ex.getMessage(), ex); + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); + Thread.sleep(5000); + System.exit(-1000); + } catch (MultiException ex) { + log.fatal("Failed to launch MOCCA, " + ex.getMessage(), ex); + if (ex.getThrowable(0) instanceof BindException) { + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); + } else { + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); + } + Thread.sleep(5000); + System.exit(-1000); + } catch (Exception e) { + log.fatal("Failed to launch MOCCA, " + e.getMessage(), e); + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); + Thread.sleep(5000); + System.exit(-1000); + } + } private void backupAndDelete(File dir, URI relativeTo, ZipOutputStream zip) throws IOException { diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index 0cd3e633..89044486 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -35,6 +35,7 @@ public class Container { } public void init() throws IOException { +// System.setProperty("DEBUG", "true"); server = new Server(); QueuedThreadPool qtp = new QueuedThreadPool(); qtp.setMaxThreads(5); @@ -55,7 +56,13 @@ public class Container { sslConnector.setAcceptors(1); sslConnector.setHost("127.0.0.1"); File configDir = new File(System.getProperty("user.home") + "/" + BKULauncher.CONFIG_DIR); - sslConnector.setKeystore(configDir.getPath() + "/" + BKULauncher.KEYSTORE_FILE); + File keystoreFile = new File(configDir, BKULauncher.KEYSTORE_FILE); + if (!keystoreFile.canRead()) { + log.error("MOCCA keystore file not readable: " + keystoreFile.getAbsolutePath()); + throw new FileNotFoundException("MOCCA keystore file not readable: " + keystoreFile.getAbsolutePath()); + } + log.debug("loading MOCCA keystore from " + keystoreFile.getAbsolutePath()); + sslConnector.setKeystore(keystoreFile.getAbsolutePath()); File passwdFile = new File(configDir, BKULauncher.PASSWD_FILE); BufferedReader reader = new BufferedReader(new FileReader(passwdFile)); String pwd; @@ -64,6 +71,42 @@ public class Container { sslConnector.setKeyPassword(pwd); } reader.close(); + + //avoid jetty's ClassCastException: iaik.security.ecc.ecdsa.ECPublicKey cannot be cast to java.security.interfaces.ECPublicKey + String[] RFC4492CipherSuites = new String[] { + "TLS_ECDH_ECDSA_WITH_NULL_SHA", + "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", + + "TLS_ECDHE_ECDSA_WITH_NULL_SHA", + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + + "TLS_ECDH_RSA_WITH_NULL_SHA", + "TLS_ECDH_RSA_WITH_RC4_128_SHA", + "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", + + "TLS_ECDHE_RSA_WITH_NULL_SHA", + "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + + "TLS_ECDH_anon_WITH_NULL_SHA", + "TLS_ECDH_anon_WITH_RC4_128_SHA", + "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", + "TLS_ECDH_anon_WITH_AES_256_CBC_SHA" + }; + + sslConnector.setExcludeCipherSuites(RFC4492CipherSuites); + server.setConnectors(new Connector[] { connector, sslConnector }); @@ -71,7 +114,7 @@ public class Container { webapp.setLogUrlOnStart(true); webapp.setContextPath("/"); webapp.setExtractWAR(true); - webapp.setParentLoaderPriority(false); //true); + webapp.setParentLoaderPriority(false); webapp.setWar(copyWebapp(webapp.getTempDirectory())); //getClass().getClassLoader().getResource("BKULocalWar/").toString()); diff --git a/BKUWebStart/src/main/jnlp/resources/player.jnlp b/BKUWebStart/src/main/jnlp/resources/player.jnlp new file mode 100644 index 00000000..da08ebc2 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/player.jnlp @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 07e1c28a..4d08d4e5 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -5,11 +5,12 @@ - $project.Name EarlyAccess + + $project.Description $project.Organization.Name - $project.Description EarlyAccess - $project.Description EarlyAccess + $project.Description + $project.Description diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties index 6ee1a510..eb2b74c0 100644 --- a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties +++ b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties @@ -6,7 +6,10 @@ Startup.Message=B\u00FCrgerkartenumgebung wird gestartet... Startup.Caption=B\u00FCrgerkartenumgebung (MOCCA Web Start) Greetings.Message=B\u00FCrgerkartenumgebung erfolgreich gestartet Greetings.Caption=B\u00FCrgerkartenumgebung (MOCCA Web Start) - +Error.Caption=Fehler +Error.Startup.Message=B\u00FCrgerkartenumgebung konnte nicht gestartet werden +Error.Conf.Message=Konfiguration konnte nicht initialisiert werden, B\u00FCrberkartenumgebung wird nicht gestartet +Error.Bind.Message=Die f\u00FCr die B\u00FCrgerkartenumgebung reservierte Adresse wird bereits von einem anderen Dienst verwendet Message.RequestCaption=New Request Message.InfoboxReadRequest=Reading Infobox Message.SecureSignatureKeypair=Reading secure signature certificate -- cgit v1.2.3 From e75f30d8d51fa33fc778c31c1b0312cf10de8e45 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 25 Jun 2009 17:01:14 +0000 Subject: disable pinpad git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@376 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/webstart/BKULauncher.java | 4 ++-- .../at/gv/egiz/bku/webstart/conf/configuration.zip | Bin 0 -> 25738 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java index 36c9cbb2..5e4ab634 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -56,8 +56,8 @@ public class BKULauncher implements BKUControllerInterface { /** configurations with less than this (major) version will be backuped and updated */ public static final String MIN_CONFIG_VERSION = "1.0.3"; public static final String CONFIG_DIR = ".mocca/conf/"; - public static final String CONF_TEMPLATE_FILE = "template.zip"; - public static final String CONF_TEMPLATE_RESOURCE = "at/gv/egiz/bku/webstart/conf/template.zip"; + public static final String CONF_TEMPLATE_FILE = "configuration.zip"; + public static final String CONF_TEMPLATE_RESOURCE = "at/gv/egiz/bku/webstart/conf/configuration.zip"; public static final String WEBAPP_RESOURCE = "BKULocal.war"; public static final String WEBAPP_FILE = "BKULocal.war"; public static final String KEYSTORE_FILE = "keystore.ks"; diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip new file mode 100644 index 00000000..74465445 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip differ -- cgit v1.2.3 From 60a139378e88719445a0958cadd4271dd5e2d6bc Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 25 Jun 2009 18:25:56 +0000 Subject: account for snapshot version in update conf git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@377 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java index 5e4ab634..abc0b8ee 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java @@ -152,11 +152,19 @@ public class BKULauncher implements BKUControllerInterface { */ private boolean updateRequired(String oldVersion, String newVersion) { if (oldVersion != null) { + log.debug("comparing " + oldVersion + " to " + MIN_CONFIG_VERSION); + int majorEnd = oldVersion.indexOf('-'); - if (majorEnd > 0) { - oldVersion = oldVersion.substring(0, majorEnd); + String oldMajor = (majorEnd < 0) ? oldVersion : oldVersion.substring(0, majorEnd); + + int compare = oldMajor.compareTo(MIN_CONFIG_VERSION); + if (compare < 0 || + // SNAPSHOT versions are pre-releases (update if release required) + (compare == 0 && oldVersion.startsWith("-SNAPSHOT", majorEnd))) { + return true; + } else { + return false; } - return (oldVersion.compareTo(MIN_CONFIG_VERSION) < 0); } log.debug("no old version, update required"); return true; -- cgit v1.2.3 From e7641b2b5861897e1e1abab3b7411bb77361d5cb Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 1 Jul 2009 12:34:54 +0000 Subject: [#425] Disable WebStart Launch Button for MacOS added standalone profile in BKU Web Start git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@379 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 32 +++++++++++++++++++-- BKUWebStart/src/main/jnlp/resources/version.xml | 6 ++-- .../at/gv/egiz/bku/webstart/conf/template.zip | Bin 24829 -> 0 bytes .../src/main/resources/splash_standalone.png | Bin 0 -> 54978 bytes 4 files changed, 33 insertions(+), 5 deletions(-) delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip create mode 100644 BKUWebStart/src/main/resources/splash_standalone.png (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index fb72f26f..09574814 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -11,9 +11,10 @@ jar BKU Web Start - 1.0.3-SNAPSHOT + 1.0.4-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung (MOCCA Web Start) @@ -276,4 +277,31 @@ --> + + + standalone (non-webstart) + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + at.gv.egiz.bku.webstart.BKULauncher + + + development + ${pom.url} + splash_standalone.png + + + + + + + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 197c05b5..872b8703 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,10 +2,10 @@ - BKUWebStart-1.0.3-SNAPSHOT.jar - 1.0.3-SNAPSHOT + BKUWebStart-1.0.4-SNAPSHOT.jar + 1.0.4-SNAPSHOT - BKUWebStart-1.0.3-SNAPSHOT.jar + BKUWebStart-1.0.4-SNAPSHOT.jar diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip deleted file mode 100644 index f14b0c19..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/template.zip and /dev/null differ diff --git a/BKUWebStart/src/main/resources/splash_standalone.png b/BKUWebStart/src/main/resources/splash_standalone.png new file mode 100644 index 00000000..72c1d868 Binary files /dev/null and b/BKUWebStart/src/main/resources/splash_standalone.png differ -- cgit v1.2.3 From 8c4be63080981cc85e1c1584f046dfd6035968c0 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 1 Jul 2009 15:05:23 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@385 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 09574814..450361a2 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -1,9 +1,9 @@ - + bku at.gv.egiz - 1.1.2-SNAPSHOT + 1.2.0 4.0.0 at.gv.egiz @@ -14,7 +14,7 @@ | IMPORTANT: update jnlp/resources/version.xml and | include-webstart profile in BKUOnline if version changes |--> - 1.0.4-SNAPSHOT + 1.0.4 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung (MOCCA Web Start) @@ -199,13 +199,13 @@ at.gv.egiz BKULocal - 1.0.5-SNAPSHOT + 1.0.5 war utils at.gv.egiz - 1.1.2-SNAPSHOT + 1.2.0 iaik_ecc_signed -- cgit v1.2.3 From d23cff9c8f01f7fff85c183fd3b482b173bb3108 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 1 Jul 2009 15:07:04 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@387 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 450361a2..0ae3feec 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -3,7 +3,7 @@ bku at.gv.egiz - 1.2.0 + 1.2.1-SNAPSHOT 4.0.0 at.gv.egiz @@ -14,7 +14,7 @@ | IMPORTANT: update jnlp/resources/version.xml and | include-webstart profile in BKUOnline if version changes |--> - 1.0.4 + 1.0.5-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung (MOCCA Web Start) @@ -199,13 +199,13 @@ at.gv.egiz BKULocal - 1.0.5 + 1.0.6-SNAPSHOT war utils at.gv.egiz - 1.2.0 + 1.2.1-SNAPSHOT iaik_ecc_signed -- cgit v1.2.3 From 53e29d4b811dc9dbd888e04b5dd8205b146a4d9d Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 1 Jul 2009 15:30:39 +0000 Subject: update resource version: 1.0.5-SNAPSHOT git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@388 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/src/main/jnlp/resources/version.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 872b8703..4e263ded 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,10 +2,10 @@ - BKUWebStart-1.0.4-SNAPSHOT.jar - 1.0.4-SNAPSHOT + BKUWebStart-1.0.5-SNAPSHOT.jar + 1.0.5-SNAPSHOT - BKUWebStart-1.0.4-SNAPSHOT.jar + BKUWebStart-1.0.5-SNAPSHOT.jar -- cgit v1.2.3 From d3f2f0b0061e1389a3d4d71468314766c446ab20 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 10 Jul 2009 15:24:10 +0000 Subject: Mac OS X (snow leopard): jvm param -d32 plugin version for webstart-maven-plugin git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@408 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- BKUWebStart/src/main/jnlp/resources/version.xml | 16 ++++++++-------- BKUWebStart/src/main/jnlp/template.xml | 12 +++++++----- 3 files changed, 16 insertions(+), 14 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 0ae3feec..9ef1914f 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -11,7 +11,7 @@ jar BKU Web Start 1.0.5-SNAPSHOT diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 4e263ded..763552fc 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -8,6 +8,14 @@ BKUWebStart-1.0.5-SNAPSHOT.jar + + + utils-1.2.1-SNAPSHOT.jar + 1.2.1-SNAPSHOT + + utils-1.2.1-SNAPSHOT.jar + + commons-logging-1.0.4.jar @@ -98,12 +106,4 @@ stax-api-1.0-2.jar - - - utils-1.1.2-SNAPSHOT.jar - 1.1.2-SNAPSHOT - - utils-1.1.2-SNAPSHOT.jar - - diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 4d08d4e5..a6f6d96e 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -1,7 +1,4 @@ - @@ -31,13 +28,18 @@ #end + + + + $dependencies + + - $dependencies - + \ No newline at end of file -- cgit v1.2.3 From 79016a7b2f9d89e52e991b0abdfc73ad24e60979 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 13 Aug 2009 09:19:28 +0000 Subject: [#433] update BKU Web Start CertStore WebStart configuration refactored git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@423 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 337 ++++++++-------- .../java/at/gv/egiz/bku/webstart/BKULauncher.java | 418 -------------------- .../java/at/gv/egiz/bku/webstart/Configurator.java | 418 ++++++++++++++++++++ .../java/at/gv/egiz/bku/webstart/Container.java | 75 +++- .../java/at/gv/egiz/bku/webstart/Launcher.java | 230 +++++++++++ .../gv/egiz/bku/webstart/LogSecurityManager.java | 440 +++++++++++++++++++++ .../at/gv/egiz/bku/webstart/ui/TrayIconDialog.java | 2 +- BKUWebStart/src/main/jnlp/resources/img/logo.png | Bin 2609 -> 0 bytes .../src/main/jnlp/resources/img/logo_16.ico | Bin 0 -> 1406 bytes .../src/main/jnlp/resources/img/logo_16.png | Bin 0 -> 1084 bytes .../src/main/jnlp/resources/img/logo_16.xpm | 274 +++++++++++++ .../src/main/jnlp/resources/img/logo_32.png | Bin 0 -> 1522 bytes .../src/main/jnlp/resources/img/logo_64.gif | Bin 0 -> 1690 bytes .../src/main/jnlp/resources/img/logo_64.jpeg | Bin 0 -> 1347 bytes .../src/main/jnlp/resources/img/logo_64.png | Bin 0 -> 1689 bytes .../src/main/jnlp/resources/img/logo_64x64.png | Bin 2299 -> 0 bytes .../src/main/jnlp/resources/img/logo_90x90.png | Bin 3294 -> 0 bytes .../src/main/jnlp/resources/img/version.xml | 32 +- BKUWebStart/src/main/jnlp/resources/version.xml | 81 +++- BKUWebStart/src/main/jnlp/template-local.xml | 42 ++ BKUWebStart/src/main/jnlp/template.xml | 22 +- BKUWebStart/src/main/jnlp/template_dev.xml | 39 -- .../at/gv/egiz/bku/webstart/conf/conf.zip | Bin 0 -> 2944 bytes .../at/gv/egiz/bku/webstart/conf/configuration.zip | Bin 25738 -> 0 bytes .../gv/egiz/bku/webstart/ui/UIMessages.properties | 8 +- .../at/gv/egiz/bku/webstart/ui/trayicon.png | Bin 2609 -> 0 bytes .../at/gv/egiz/bku/webstart/ui/trayicon_16.png | Bin 0 -> 1084 bytes .../at/gv/egiz/bku/webstart/ui/trayicon_32.png | Bin 0 -> 2609 bytes BKUWebStart/src/main/resources/log4j.properties | 23 +- 29 files changed, 1770 insertions(+), 671 deletions(-) delete mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_16.ico create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_16.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_32.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64.gif create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png create mode 100644 BKUWebStart/src/main/jnlp/template-local.xml delete mode 100644 BKUWebStart/src/main/jnlp/template_dev.xml create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 9ef1914f..a8e33a58 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -14,54 +14,24 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.0.5-SNAPSHOT + 1.0.9-SNAPSHOT http://mocca.egovlabs.gv.at/ - Bürgerkartenumgebung (MOCCA Web Start) - + Bürgerkartenumgebung + - - - + - org.apache.maven.plugins maven-dependency-plugin - - - - - - - copy BKULocal webapp - - copy-dependencies - - - at.gv.egiz - BKULocal - war - ${project.build.directory}/classes/ true + - org.codehaus.mojo.webstart webstart-maven-plugin + org.codehaus.mojo.webstart - + package - jnlp-inline @@ -113,56 +84,44 @@ - false - - - - ${project.basedir}/src/main/jnlp - template.xml - mocca.jnlp - at.gv.egiz.bku.webstart.BKULauncher + template-local.xml + mocca-local.jnlp + at.gv.egiz.bku.webstart.Launcher 1.6+ true true - test-applet signer ${project.basedir}/keystore.ks + storepass - keypass - true + keypass + true - false - false + false + false - - - true - - - - true - - + false + + false + true - - true - - org.codehaus.mojo maven-buildnumber-plugin + org.codehaus.mojo validate @@ -178,8 +137,8 @@ - org.apache.maven.plugins maven-jar-plugin + org.apache.maven.plugins @@ -194,114 +153,150 @@ - - - - at.gv.egiz - BKULocal - 1.0.6-SNAPSHOT - war - - - utils - at.gv.egiz - 1.2.1-SNAPSHOT - - - iaik_ecc_signed - iaik - - - - - commons-logging - commons-logging - 1.0.4 - - - org.mortbay.jetty - jetty - 6.1.15 - - - - + 1.0-beta-1-SNAPSHOT + + + NONE + PKCS11 + iaik.pkcs.pkcs11.provider.IAIKPkcs11 + a-sit + + true + + false + false + + + true + + true + + - - --> - - standalone (non-webstart) + include-webstart - org.apache.maven.plugins - maven-jar-plugin - - - - true - at.gv.egiz.bku.webstart.BKULauncher - - - development - ${pom.url} - splash_standalone.png - - - - + webstart-maven-plugin + org.codehaus.mojo.webstart + + + template.xml + mocca.jnlp + + false + + true + + - \ No newline at end of file + + + at.gv.egiz + BKULocal + 1.0.6-SNAPSHOT + war + + + at.gv.egiz + BKUCertificates + 1.0-SNAPSHOT + + + utils + at.gv.egiz + 1.2.1-SNAPSHOT + + + iaik_ecc_signed + iaik + + + + + commons-logging + commons-logging + + + + + org.mortbay.jetty + jetty + 6.1.19 + + + + org.mortbay.jetty + jsp-2.1-jetty + 6.1.19 + + + org.slf4j + slf4j-api + 1.5.8 + + + org.slf4j + slf4j-log4j12 + 1.5.8 + + + + + jre + javaws + 6.0 + jar + system + ${java.home}/lib/javaws.jar + + + diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java deleted file mode 100644 index abc0b8ee..00000000 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java +++ /dev/null @@ -1,418 +0,0 @@ -package at.gv.egiz.bku.webstart; - -import iaik.asn1.CodingException; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.util.Enumeration; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -//import org.apache.commons.cli.CommandLine; -//import org.apache.commons.cli.CommandLineParser; -//import org.apache.commons.cli.HelpFormatter; -//import org.apache.commons.cli.Options; -//import org.apache.commons.cli.ParseException; -//import org.apache.commons.cli.PosixParser; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.webstart.ui.BKUControllerInterface; -import at.gv.egiz.bku.webstart.ui.TrayIconDialog; -import at.gv.egiz.bku.utils.StreamUtil; -import java.awt.Desktop; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.FileWriter; -import java.net.BindException; -import java.net.URI; -import java.net.URL; -import java.security.GeneralSecurityException; -import java.util.UUID; -import java.util.jar.Attributes; -import java.util.jar.Manifest; -import java.util.zip.ZipOutputStream; -import org.mortbay.util.MultiException; - -public class BKULauncher implements BKUControllerInterface { - - /** configurations with less than this (major) version will be backuped and updated */ - public static final String MIN_CONFIG_VERSION = "1.0.3"; - public static final String CONFIG_DIR = ".mocca/conf/"; - public static final String CONF_TEMPLATE_FILE = "configuration.zip"; - public static final String CONF_TEMPLATE_RESOURCE = "at/gv/egiz/bku/webstart/conf/configuration.zip"; - public static final String WEBAPP_RESOURCE = "BKULocal.war"; - public static final String WEBAPP_FILE = "BKULocal.war"; - public static final String KEYSTORE_FILE = "keystore.ks"; - public static final String MESSAGES_RESOURCE = "at/gv/egiz/bku/webstart/ui/UIMessages"; - public static final String PASSWD_FILE = ".secret"; - /** resource bundle messages */ - public static final String GREETING_CAPTION = "Greetings.Caption"; - public static final String GREETING_MESSAGE = "Greetings.Message"; - public static final String STARTUP_CAPTION = "Startup.Caption"; - public static final String ERROR_CAPTION = "Error.Caption"; - public static final String STARTUP_MESSAGE = "Startup.Message"; - public static final String ERROR_STARTUP_MESSAGE = "Error.Startup.Message"; - public static final String ERROR_CONF_MESSAGE = "Error.Conf.Message"; - public static final String ERROR_BIND_MESSAGE = "Error.Bind.Message"; - public static final String VERSION_FILE = ".version"; - private static Log log = LogFactory.getLog(BKULauncher.class); - private ResourceBundle resourceBundle = null; - private Container server; - - private void createConfig(File configDir, File versionFile, String version) throws IOException, CertificateException, GeneralSecurityException, KeyStoreException, FileNotFoundException, NoSuchAlgorithmException { - log.debug("creating config directory: " + configDir); - configDir.mkdirs(); - InputStream is = getClass().getClassLoader().getResourceAsStream(CONF_TEMPLATE_RESOURCE); - OutputStream os = new FileOutputStream(new File(configDir, CONF_TEMPLATE_FILE)); - StreamUtil.copyStream(is, os); - os.close(); - File confTemplateFile = new File(configDir, CONF_TEMPLATE_FILE); - unzip(confTemplateFile); - confTemplateFile.delete(); - writeVersionFile(versionFile, version); - } - - private void createCertificates(File configDir) throws IOException, GeneralSecurityException, CodingException { - char[] password = UUID.randomUUID().toString().toCharArray(); - File passwdFile = new File(configDir, PASSWD_FILE); - FileWriter passwdWriter = new FileWriter(passwdFile); - passwdWriter.write(password); - passwdWriter.close(); - if (!passwdFile.setReadable(true, true)) { - passwdFile.delete(); - throw new IOException("failed to make " + passwdFile + " owner readable only, deleting file"); - } - TLSServerCA ca = new TLSServerCA(); - KeyStore ks = ca.generateKeyStore(password); - FileOutputStream fos = new FileOutputStream(new File(configDir, KEYSTORE_FILE)); - ks.store(fos, password); - fos.close(); - } - - private String getFileVersion(File versionFile) throws FileNotFoundException, IOException { - //TODO no file? - if (versionFile.exists() && versionFile.canRead()) { - BufferedReader versionReader = new BufferedReader(new FileReader(versionFile)); - String versionString = null; - while ((versionString = versionReader.readLine().trim()) != null) { - if (versionString.length() > 0 && !versionString.startsWith("#")) { - log.debug("found existing configuration version " + versionString); - break; - } - } - return versionString; - } - return null; - } - - private String getManifestVersion() throws MalformedURLException, IOException { - String bkuWebStartJar = BKULauncher.class.getProtectionDomain().getCodeSource().getLocation().toString(); - URL manifestURL = new URL("jar:" + bkuWebStartJar + "!/META-INF/MANIFEST.MF"); - String version = null; - if (manifestURL != null) { - Manifest manifest = new Manifest(manifestURL.openStream()); - if (log.isTraceEnabled()) { - log.trace("read version information from " + manifestURL); - } - Attributes atts = manifest.getMainAttributes(); - if (atts != null) { - version = atts.getValue("Implementation-Build"); - } - } - if (version == null) { - version = "UNKNOWN"; - } - log.debug("config version: " + version); - return version; - } - - /** - * change the - * @param oldVersion - * @param newVersion - * @return - */ - private boolean updateRequired(String oldVersion, String newVersion) { - if (oldVersion != null) { - log.debug("comparing " + oldVersion + " to " + MIN_CONFIG_VERSION); - - int majorEnd = oldVersion.indexOf('-'); - String oldMajor = (majorEnd < 0) ? oldVersion : oldVersion.substring(0, majorEnd); - - int compare = oldMajor.compareTo(MIN_CONFIG_VERSION); - if (compare < 0 || - // SNAPSHOT versions are pre-releases (update if release required) - (compare == 0 && oldVersion.startsWith("-SNAPSHOT", majorEnd))) { - return true; - } else { - return false; - } - } - log.debug("no old version, update required"); - return true; - } - - private boolean updateRequiredStrict(String oldVersion, String newVersion) { - String[] oldV = oldVersion.split("-"); - String[] newV = newVersion.split("-"); - log.debug("comparing " + oldV[0] + " to " + newV[0]); - if (oldV[0].compareTo(newV[0]) < 0) { - log.debug("update required"); - return true; - } else { - log.debug("comparing " + oldV[oldV.length - 1] + " to " + newV[newV.length - 1]); - if (oldV[oldV.length - 1].compareTo(newV[newV.length - 1]) < 0) { - log.debug("update required"); - return true; - } else { - log.debug("no update required"); - return false; - } - } - } - - private void writeVersionFile(File versionFile, String version) throws IOException { - BufferedWriter versionWriter = new BufferedWriter(new FileWriter(versionFile)); - versionWriter.write("# MOCCA Web Start configuration version\n"); - versionWriter.write("# DO NOT MODIFY THIS FILE\n\n"); - versionWriter.write(version); - versionWriter.close(); - } - -// private SplashScreen splash = SplashScreen.getSplashScreen(); - private void startUpServer() throws Exception { - log.info("init servlet container and MOCCA webapp"); - server = new Container(); - // XmlConfiguration xcfg = new XmlConfiguration(getClass().getClassLoader() - // .getResourceAsStream("at/gv/egiz/bku/local/app/jetty.xml")); - // xcfg.configure(server); - server.init(); - server.start(); - } - - private void initTrayIcon() { - log.debug("init MOCCA tray icon"); - Locale loc = Locale.getDefault(); - try { - resourceBundle = ResourceBundle.getBundle( - MESSAGES_RESOURCE, loc); - } catch (MissingResourceException mx) { - resourceBundle = ResourceBundle.getBundle( - MESSAGES_RESOURCE, Locale.ENGLISH); - } - TrayIconDialog.getInstance().init(resourceBundle); - TrayIconDialog.getInstance().setShutdownHook(this); -// TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); - } - - private void initStart() { - } - - private void initFinished(boolean installCert) { - try { -// if (splash != null) { -// try { -// splash.close(); -// } catch (IllegalStateException ex) { -// log.warn("Failed to close splash screen: " + ex.getMessage()); -// } -// } - - if (installCert) { - log.debug("trying install MOCCA certificate on system browser"); - if (Desktop.isDesktopSupported()) { - Desktop desktop = Desktop.getDesktop(); - if (desktop.isSupported(Desktop.Action.BROWSE)) { - try { - desktop.browse(new URI("https://localhost:" + - Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue())); - } catch (Exception ex) { - log.error("failed to open system browser, install MOCCA certificate manually", ex); - } - } else { - log.error("failed to open system browser, install MOCCA certificate manually"); - } - } else { - log.error("failed to open system browser, install MOCCA certificate manually"); - } - } - - log.info("init completed, joining server"); - server.join(); - } catch (InterruptedException e) { - log.warn("failed to join MOCCA server: " + e.getMessage(), e); - } - } - - private void unzip(File zipfile) throws IOException { - File dir = zipfile.getParentFile(); - ZipFile zipFile = new ZipFile(zipfile); - Enumeration entries = zipFile.entries(); - while (entries.hasMoreElements()) { - ZipEntry entry = entries.nextElement(); - File eF = new File(dir, entry.getName()); - if (entry.isDirectory()) { - eF.mkdirs(); - continue; - } - File f = new File(eF.getParent()); - f.mkdirs(); - StreamUtil.copyStream(zipFile.getInputStream(entry), - new FileOutputStream(eF)); - } - zipFile.close(); - } - - /** - * @param args - */ - public static void main(String[] args) throws InterruptedException { - - if (log.isDebugEnabled()) { - //System.setProperty("DEBUG", "true"); - System.setProperty("VERBOSE", "true"); - System.setProperty("javax.net.debug", "ssl,handshake"); - } - -// log.warn("***** DISABLING SECURITY MANAGER *******"); - System.setSecurityManager(null); - - BKULauncher launcher = new BKULauncher(); - launcher.initStart(); - - boolean installCert = false; - - launcher.initTrayIcon(); - TrayIconDialog.getInstance().displayInfo(STARTUP_CAPTION, STARTUP_MESSAGE); - - try { - File configDir = new File(System.getProperty("user.home") + '/' + CONFIG_DIR); - installCert = launcher.ensureConfig(configDir); - } catch (Exception ex) { - log.fatal("Failed to init MOCCA configuration, exiting", ex); - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_CONF_MESSAGE); - Thread.sleep(5000); - System.exit(-1000); - } - - try { - launcher.startUpServer(); - TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); - launcher.initFinished(installCert); - } catch (BindException ex) { - log.fatal("Failed to launch MOCCA, " + ex.getMessage(), ex); - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); - Thread.sleep(5000); - System.exit(-1000); - } catch (MultiException ex) { - log.fatal("Failed to launch MOCCA, " + ex.getMessage(), ex); - if (ex.getThrowable(0) instanceof BindException) { - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); - } else { - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); - } - Thread.sleep(5000); - System.exit(-1000); - } catch (Exception e) { - log.fatal("Failed to launch MOCCA, " + e.getMessage(), e); - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); - Thread.sleep(5000); - System.exit(-1000); - } - - } - - private void backupAndDelete(File dir, URI relativeTo, ZipOutputStream zip) throws IOException { - if (dir.isDirectory()) { - File[] subDirs = dir.listFiles(); - for (File subDir : subDirs) { - backupAndDelete(subDir, relativeTo, zip); - subDir.delete(); - } - } else { - URI relativePath = relativeTo.relativize(dir.toURI()); - ZipEntry entry = new ZipEntry(relativePath.toString()); - zip.putNextEntry(entry); - BufferedInputStream entryIS = new BufferedInputStream(new FileInputStream(dir)); - StreamUtil.copyStream(entryIS, zip); - entryIS.close(); - zip.closeEntry(); - dir.delete(); - } - } - - /** - * Checks whether the config directory already exists and creates it otherwise. - * @param configDir the config directory to be created - * @return true if a new MOCCA cert was created (and needs to be installed in the browser) - */ - private boolean ensureConfig(File configDir) throws IOException, GeneralSecurityException, CodingException { - log.debug("config directory: " + configDir); - String manifestVersion = getManifestVersion(); - File versionFile = new File(configDir, VERSION_FILE); - - if (configDir.exists()) { - if (configDir.isFile()) { - log.error("invalid config directory: " + configDir); - throw new IOException("invalid config directory: " + configDir); - } else { - String fileVersion = getFileVersion(versionFile); - if (updateRequired(fileVersion, manifestVersion)) { - if (fileVersion == null) { - fileVersion = "unknown"; - } - log.info("updating configuration from " + fileVersion + " to " + manifestVersion); - File moccaDir = configDir.getParentFile(); - File zipFile = new File(moccaDir, "conf-" + fileVersion + ".zip"); - ZipOutputStream zipOS = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile))); - backupAndDelete(configDir, moccaDir.toURI(), zipOS); - zipOS.close(); - createConfig(configDir, versionFile, manifestVersion); - createCertificates(configDir); - return true; - } - } - } else { - createConfig(configDir, versionFile, manifestVersion); - createCertificates(configDir); - return true; - } - return false; - } - - public void shutDown() { - log.info("Shutting down server"); - if ((server != null) && (server.isRunning())) { - try { - if (server.isRunning()) { - server.stop(); - } - } catch (Exception e) { - log.debug(e.toString()); - } finally { - if (server.isRunning()) { - server.destroy(); - } - } - } - System.exit(0); - } -} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java new file mode 100644 index 00000000..ab1746ed --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java @@ -0,0 +1,418 @@ +/* + * 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; + +import at.gv.egiz.bku.utils.StreamUtil; +import iaik.asn1.CodingException; +import iaik.xml.crypto.utils.Utils; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.jar.Attributes; +import java.util.jar.Manifest; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.eclipse.jdt.core.dom.ThisExpression; + +/** + * + * @author Clemens Orthacker + */ +public class Configurator { + + /** + * MOCCA configuration + * configurations with less than this (major) version will be backuped and updated + * allowed: MAJOR[.MINOR[.X[-SNAPSHOT]]] + */ + public static final String MIN_CONFIG_VERSION = "1.0.9-SNAPSHOT"; + public static final String CONFIG_DIR = ".mocca/conf/"; + public static final String CERTS_DIR = ".mocca/certs/"; + public static final String VERSION_FILE = ".version"; + public static final String UNKOWN_VERSION = "unknown"; + public static final String CONF_TEMPLATE_FILE = "conf-tmp.zip"; + public static final String CONF_TEMPLATE_RESOURCE = "at/gv/egiz/bku/webstart/conf/conf.zip"; + public static final String CERTIFICATES_PKG = "at/gv/egiz/bku/certs"; + + /** + * MOCCA TLS certificate + */ + public static final String KEYSTORE_FILE = "keystore.ks"; + public static final String PASSWD_FILE = ".secret"; + + private static final Log log = LogFactory.getLog(Configurator.class); + + /** currently installed configuration version */ + private String version; + private String certsVersion; + /** whether a new MOCCA TLS cert was created during initialization */ + private boolean certRenewed = false; + + /** + * Checks whether the config directory already exists and creates it otherwise. + * @param configDir the config directory to be created + * @throws IOException config/certificate creation failed + * @throws GeneralSecurityException if MOCCA TLS certificate could not be created + * @throws CodingException if MOCCA TLS certificate could not be created + */ + public void ensureConfiguration() throws IOException, CodingException, GeneralSecurityException { + File configDir = new File(System.getProperty("user.home") + '/' + CONFIG_DIR); + if (configDir.exists()) { + if (configDir.isFile()) { + log.error("invalid config directory: " + configDir); + throw new IOException("invalid config directory: " + configDir); + } else { + version = readVersion(new File(configDir, VERSION_FILE)); + if (log.isDebugEnabled()) { + log.debug("config directory " + configDir + ", version " + version); + } + if (updateRequired(version)) { + File moccaDir = configDir.getParentFile(); + File zipFile = new File(moccaDir, "conf-" + version + ".zip"); + ZipOutputStream zipOS = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile))); + log.info("backup configuration to " + zipFile); + backupAndDelete(configDir, moccaDir.toURI(), zipOS); + zipOS.close(); + initConfig(configDir); + } + } + } else { + initConfig(configDir); + } + } + + /** + * To be replaced by TSLs in IAIK-PKI + * @throws IOException + */ + public void ensureCertificates() throws IOException { + File certsDir = new File(System.getProperty("user.home") + '/' + CERTS_DIR); + if (certsDir.exists()) { + if (certsDir.isFile()) { + log.error("invalid certificate store directory: " + certsDir); + throw new IOException("invalid config directory: " + certsDir); + } else { + certsVersion = readVersion(new File(certsDir, VERSION_FILE)); + if (log.isDebugEnabled()) { + log.debug("certificate-store directory " + certsDir + ", version " + certsVersion); + } + String newCertsVersion = getCertificatesVersion(); + if (updateRequiredStrict(certsVersion, newCertsVersion)) { + File moccaDir = certsDir.getParentFile(); + File zipFile = new File(moccaDir, "certs-" + certsVersion + ".zip"); + ZipOutputStream zipOS = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile))); + log.info("backup certificates to " + zipFile); + backupAndDelete(certsDir, moccaDir.toURI(), zipOS); + zipOS.close(); + + createCerts(certsDir, newCertsVersion); + certsVersion = newCertsVersion; + } + } + } else { + String newCertsVersion = getCertificatesVersion(); + createCerts(certsDir, newCertsVersion); + certsVersion = newCertsVersion; + } + } + + /** + * + * @return whether a new MOCCA TLS certificate has been created during initialization + */ + public boolean isCertRenewed() { + return certRenewed; + } + + /** + * @return The first valid (not empty, no comment) line of the version file or + * "unknown" if version file cannot be read or does not contain such a line. + */ + protected static String readVersion(File versionFile) { + if (versionFile.exists() && versionFile.canRead()) { + BufferedReader versionReader = null; + try { + versionReader = new BufferedReader(new FileReader(versionFile)); + String version; + while ((version = versionReader.readLine().trim()) != null) { + if (version.length() > 0 && !version.startsWith("#")) { + log.debug("configuration version from " + versionFile + ": " + version); + return version; + } + } + } catch (IOException ex) { + log.error("failed to read configuration version from " + versionFile, ex); + } finally { + try { + versionReader.close(); + } catch (IOException ex) { + } + } + } + log.debug("unknown configuration version"); + return UNKOWN_VERSION; + } + + /** + * Temporary workaround, replace with TSLs in IAIK-PKI. + * Retrieves version from BKUCertificates.jar Manifest file. + * The (remote) resource URL will be handled by the JNLP loader, + * and the resource retrieved from the cache. + * + * @return + * @throws IOException + */ + private static String getCertificatesVersion() throws IOException { + String certsResourceVersion = null; + URL certsURL = Configurator.class.getClassLoader().getResource(CERTIFICATES_PKG); + if (certsURL != null) { + StringBuilder url = new StringBuilder(certsURL.toExternalForm()); + url = url.replace(url.length() - CERTIFICATES_PKG.length(), url.length(), "META-INF/MANIFEST.MF"); + log.trace("retrieve certificates resource version from " + url); + certsURL = new URL(url.toString()); + Manifest certsManifest = new Manifest(certsURL.openStream()); + Attributes atts = certsManifest.getMainAttributes(); + if (atts != null) { + certsResourceVersion = atts.getValue("Implementation-Version"); + log.debug("certs resource version: " + certsResourceVersion); + } + } else { + log.error("Failed to retrieve certificates resource " + CERTIFICATES_PKG); + throw new IOException("Failed to retrieve certificates resource " + CERTIFICATES_PKG); + } + return certsResourceVersion; + } + + protected static boolean updateRequired(String oldVersion) { + log.debug("comparing " + oldVersion + " to " + MIN_CONFIG_VERSION); + if (oldVersion != null && !UNKOWN_VERSION.equals(oldVersion)) { + + int majorEnd = oldVersion.indexOf('-'); + String oldMajor = (majorEnd < 0) ? oldVersion : oldVersion.substring(0, majorEnd); + + String minMajor = MIN_CONFIG_VERSION; + boolean releaseRequired = true; + if (MIN_CONFIG_VERSION.endsWith("-SNAPSHOT")) { + releaseRequired = false; + minMajor = minMajor.substring(0, minMajor.length() - 9); + } + + int compare = oldMajor.compareTo(minMajor); + if (compare < 0 || + // SNAPSHOT versions are pre-releases (update if release required) + (compare == 0 && releaseRequired && oldVersion.startsWith("-SNAPSHOT", majorEnd))) { + log.debug("configuration update required"); + return true; + } else { + log.debug("configuration up to date"); + return false; + } + } + log.debug("no old version, configuration update required"); + return true; + } + + /** + * if unknown old, update in any case + * if known old and unknown new, don't update + * @param oldVersion + * @param newVersion + * @return + */ + private boolean updateRequiredStrict(String oldVersion, String newVersion) { + log.debug("comparing " + oldVersion + " to " + newVersion); + if (oldVersion != null && !UNKOWN_VERSION.equals(oldVersion)) { + if (newVersion != null && !UNKOWN_VERSION.equals(newVersion)) { + String[] oldV = oldVersion.split("-"); + String[] newV = newVersion.split("-"); + log.trace("comparing " + oldV[0] + " to " + newV[0]); + if (oldV[0].compareTo(newV[0]) < 0) { + log.debug("update required"); + return true; + } else { + log.trace("comparing " + oldV[oldV.length - 1] + " to " + newV[newV.length - 1]); + if (oldV[oldV.length - 1].compareTo(newV[newV.length - 1]) < 0) { + log.debug("update required"); + return true; + } else { + log.debug("no update required"); + return false; + } + } + } + log.debug("unknown new version, do not update"); + return true; + } + log.debug("unknown old version, update required"); + return true; + } + + protected static void backupAndDelete(File dir, URI relativeTo, ZipOutputStream zip) throws IOException { + if (dir.isDirectory()) { + File[] subDirs = dir.listFiles(); + for (File subDir : subDirs) { + backupAndDelete(subDir, relativeTo, zip); + subDir.delete(); + } + } else { + URI relativePath = relativeTo.relativize(dir.toURI()); + ZipEntry entry = new ZipEntry(relativePath.toString()); + zip.putNextEntry(entry); + BufferedInputStream entryIS = new BufferedInputStream(new FileInputStream(dir)); + StreamUtil.copyStream(entryIS, zip); + entryIS.close(); + zip.closeEntry(); + dir.delete(); + } + } + + /** + * set up a new MOCCA local configuration + * (not to be called directly, call ensureConfiguration()) + * @throws IOException config/certificate creation failed + * @throws GeneralSecurityException if MOCCA TLS certificate could not be created + * @throws CodingException if MOCCA TLS certificate could not be created + */ + protected void initConfig(File configDir) throws IOException, GeneralSecurityException, CodingException { + createConfig(configDir, Launcher.version); + version = Launcher.version; + createKeyStore(configDir); + certRenewed = true; + } + + private static void createConfig(File configDir, String version) throws IOException { + if (log.isDebugEnabled()) { + log.debug("creating configuration version " + Launcher.version + " in " + configDir ); + } + configDir.mkdirs(); + File confTemplateFile = new File(configDir, CONF_TEMPLATE_FILE); + InputStream is = Configurator.class.getClassLoader().getResourceAsStream(CONF_TEMPLATE_RESOURCE); + OutputStream os = new BufferedOutputStream(new FileOutputStream(confTemplateFile)); + StreamUtil.copyStream(is, os); + os.close(); + unzip(confTemplateFile, configDir); + confTemplateFile.delete(); + writeVersionFile(new File(configDir, VERSION_FILE), version); + } + + /** + * set up a new MOCCA local certStore + * @throws IOException config/certificate creation failed + * @throws GeneralSecurityException if MOCCA TLS certificate could not be created + * @throws CodingException if MOCCA TLS certificate could not be created + */ + private static void createCerts(File certsDir, String certsVersion) throws IOException { + if (log.isDebugEnabled()) { + log.debug("creating certificate-store " + certsDir + ", version " + certsVersion); + } + URL certsURL = Configurator.class.getClassLoader().getResource(CERTIFICATES_PKG); + if (certsURL != null) { + StringBuilder url = new StringBuilder(certsURL.toExternalForm()); + url = url.replace(url.length() - CERTIFICATES_PKG.length(), url.length(), "META-INF/MANIFEST.MF"); + log.debug("retrieve certificate resource names from " + url); + certsURL = new URL(url.toString()); + Manifest certsManifest = new Manifest(certsURL.openStream()); + certsDir.mkdirs(); + Iterator entries = certsManifest.getEntries().keySet().iterator(); + while (entries.hasNext()) { + String entry = entries.next(); + if (entry.startsWith(CERTIFICATES_PKG)) { + String f = entry.substring(CERTIFICATES_PKG.length()); // "/trustStore/..." + new File(certsDir, f.substring(0, f.lastIndexOf('/'))).mkdirs(); + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(certsDir, f))); + log.debug(f); + StreamUtil.copyStream(Configurator.class.getClassLoader().getResourceAsStream(entry), bos); + bos.close(); + } else { + log.trace("ignore " + entry); + } + } + writeVersionFile(new File(certsDir, VERSION_FILE), certsVersion); + } else { + log.error("Failed to retrieve certificates resource " + CERTIFICATES_PKG); + throw new IOException("Failed to retrieve certificates resource " + CERTIFICATES_PKG); + } + } + + private static void unzip(File zipfile, File toDir) throws IOException { + ZipFile zipFile = new ZipFile(zipfile); + Enumeration entries = zipFile.entries(); + while (entries.hasMoreElements()) { + ZipEntry entry = entries.nextElement(); + File eF = new File(toDir, entry.getName()); + if (entry.isDirectory()) { + eF.mkdirs(); + continue; + } + File f = new File(eF.getParent()); + f.mkdirs(); + StreamUtil.copyStream(zipFile.getInputStream(entry), + new FileOutputStream(eF)); + } + zipFile.close(); + } + + private static void writeVersionFile(File versionFile, String version) throws IOException { + BufferedWriter versionWriter = new BufferedWriter(new FileWriter(versionFile)); + versionWriter.write("# MOCCA Web Start configuration version\n"); + versionWriter.write("# DO NOT MODIFY THIS FILE\n\n"); + versionWriter.write(version); + versionWriter.close(); + } + + private static void createKeyStore(File configDir) throws IOException, GeneralSecurityException, CodingException { + char[] password = UUID.randomUUID().toString().toCharArray(); + File passwdFile = new File(configDir, PASSWD_FILE); + FileWriter passwdWriter = new FileWriter(passwdFile); + passwdWriter.write(password); + passwdWriter.close(); + if (!passwdFile.setReadable(false, false) || !passwdFile.setReadable(true, true)) { + passwdFile.delete(); + throw new IOException("failed to make " + passwdFile + " owner readable only, deleting file"); + } + TLSServerCA ca = new TLSServerCA(); + KeyStore ks = ca.generateKeyStore(password); + File ksFile = new File(configDir, KEYSTORE_FILE); + FileOutputStream fos = new FileOutputStream(ksFile); + ks.store(fos, password); + fos.close(); + } +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index 89044486..4df90ab2 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -1,22 +1,28 @@ package at.gv.egiz.bku.webstart; import at.gv.egiz.bku.utils.StreamUtil; +import java.awt.AWTPermission; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.FilePermission; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.lang.reflect.ReflectPermission; +import java.net.NetPermission; +import java.net.SocketPermission; +import java.security.Permissions; +import java.security.SecurityPermission; +import java.util.PropertyPermission; +import javax.smartcardio.CardPermission; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mortbay.jetty.Connector; -import org.mortbay.jetty.Handler; import org.mortbay.jetty.Server; -import org.mortbay.jetty.handler.DefaultHandler; -import org.mortbay.jetty.handler.HandlerCollection; import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.security.SslSocketConnector; import org.mortbay.jetty.webapp.WebAppContext; @@ -28,12 +34,18 @@ public class Container { public static final String HTTPS_PORT_PROPERTY = "mocca.http.port"; private static Log log = LogFactory.getLog(Container.class); + static { + if (log.isDebugEnabled()) { + //Jetty log INFO and WARN, include ignored exceptions + //jetty logging may be further restricted by setting level in log4j.properties + System.setProperty("VERBOSE", "true"); + //do not set Jetty DEBUG logging, produces loads of output + //System.setProperty("DEBUG", "true"); + } + } private Server server; - public Container() { - } - public void init() throws IOException { // System.setProperty("DEBUG", "true"); server = new Server(); @@ -55,15 +67,15 @@ public class Container { sslConnector.setPort(Integer.getInteger(HTTPS_PORT_PROPERTY, 3496).intValue()); sslConnector.setAcceptors(1); sslConnector.setHost("127.0.0.1"); - File configDir = new File(System.getProperty("user.home") + "/" + BKULauncher.CONFIG_DIR); - File keystoreFile = new File(configDir, BKULauncher.KEYSTORE_FILE); + File configDir = new File(System.getProperty("user.home") + "/" + Configurator.CONFIG_DIR); + File keystoreFile = new File(configDir, Configurator.KEYSTORE_FILE); if (!keystoreFile.canRead()) { log.error("MOCCA keystore file not readable: " + keystoreFile.getAbsolutePath()); throw new FileNotFoundException("MOCCA keystore file not readable: " + keystoreFile.getAbsolutePath()); } log.debug("loading MOCCA keystore from " + keystoreFile.getAbsolutePath()); sslConnector.setKeystore(keystoreFile.getAbsolutePath()); - File passwdFile = new File(configDir, BKULauncher.PASSWD_FILE); + File passwdFile = new File(configDir, Configurator.PASSWD_FILE); BufferedReader reader = new BufferedReader(new FileReader(passwdFile)); String pwd; while ((pwd = reader.readLine()) != null) { @@ -107,7 +119,6 @@ public class Container { sslConnector.setExcludeCipherSuites(RFC4492CipherSuites); - server.setConnectors(new Connector[] { connector, sslConnector }); WebAppContext webapp = new WebAppContext(); @@ -116,13 +127,13 @@ public class Container { webapp.setExtractWAR(true); webapp.setParentLoaderPriority(false); - webapp.setWar(copyWebapp(webapp.getTempDirectory())); //getClass().getClassLoader().getResource("BKULocalWar/").toString()); - + webapp.setWar(copyWebapp(webapp.getTempDirectory())); + webapp.setPermissions(getPermissions(webapp.getTempDirectory())); + server.setHandler(webapp); server.setGracefulShutdown(1000*3); } - private String copyWebapp(File webappDir) throws IOException { File webapp = new File(webappDir, "BKULocal.war"); log.debug("copying BKULocal classpath resource to " + webapp); @@ -133,6 +144,44 @@ public class Container { return webapp.getPath(); } + private Permissions getPermissions(File webappDir) { + Permissions perms = new Permissions(); + + // jetty-webstart (spring?) + perms.add(new RuntimePermission("getClassLoader")); + + // standard permissions + perms.add(new PropertyPermission("*", "read")); + perms.add(new RuntimePermission("accessDeclaredMembers")); + perms.add(new RuntimePermission("accessClassInPackage.*")); + perms.add(new RuntimePermission("defineClassInPackage.*")); + perms.add(new RuntimePermission("setFactory")); + perms.add(new RuntimePermission("getProtectionDomain")); + perms.add(new RuntimePermission("modifyThread")); + perms.add(new RuntimePermission("modifyThreadGroup")); + perms.add(new RuntimePermission("setFactory")); + perms.add(new ReflectPermission("suppressAccessChecks")); + + // MOCCA specific + perms.add(new SocketPermission("*", "connect,resolve")); + perms.add(new NetPermission("specifyStreamHandler")); + perms.add(new SecurityPermission("insertProvider.*")); + perms.add(new SecurityPermission("putProviderProperty.*")); + perms.add(new SecurityPermission("removeProvider.*")); + perms.add(new CardPermission("*", "*")); + perms.add(new AWTPermission("*")); + + perms.add(new FilePermission(webappDir.getAbsolutePath() + "/-", "read")); + perms.add(new FilePermission(new File(System.getProperty("java.home") + "/lib/xalan.properties").getAbsolutePath(), "read")); + perms.add(new FilePermission(new File(System.getProperty("java.home") + "/lib/xerces.properties").getAbsolutePath(), "read")); + perms.add(new FilePermission(new File(System.getProperty("user.home")).getAbsolutePath(), "read, write")); + perms.add(new FilePermission(new File(System.getProperty("user.home") + "/-").getAbsolutePath(), "read, write")); + perms.add(new FilePermission(new File(System.getProperty("user.home") + "/.mocca/logs/*").getAbsolutePath(), "read, write,delete")); + + + return perms; + } + public void start() throws Exception { server.start(); } 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 new file mode 100644 index 00000000..f7be7b65 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java @@ -0,0 +1,230 @@ +package at.gv.egiz.bku.webstart; + +import iaik.asn1.CodingException; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import javax.jnlp.UnavailableServiceException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.webstart.ui.BKUControllerInterface; +import at.gv.egiz.bku.webstart.ui.TrayIconDialog; +import com.sun.javaws.security.JavaWebStartSecurity; +import java.awt.Desktop; +import java.awt.SplashScreen; +import java.net.BindException; +import java.net.URI; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.util.jar.Attributes; +import java.util.jar.Manifest; +import javax.jnlp.BasicService; +import javax.jnlp.ServiceManager; +import org.mortbay.util.MultiException; + +public class Launcher implements BKUControllerInterface { + + public static final String WEBAPP_RESOURCE = "BKULocal.war"; + public static final String CERTIFICATES_RESOURCE = "BKUCertificates.jar"; + public static final String WEBAPP_FILE = "BKULocal.war"; + public static final String MESSAGES_RESOURCE = "at/gv/egiz/bku/webstart/ui/UIMessages"; + /** resource bundle messages */ + public static final String GREETING_CAPTION = "Greetings.Caption"; + public static final String GREETING_MESSAGE = "Greetings.Message"; + public static final String CONFIG_CAPTION = "Config.Caption"; + public static final String CONFIG_MESSAGE = "Config.Message"; + public static final String STARTUP_CAPTION = "Startup.Caption"; + public static final String STARTUP_MESSAGE = "Startup.Message"; + public static final String ERROR_CAPTION = "Error.Caption"; + public static final String ERROR_STARTUP_MESSAGE = "Error.Startup.Message"; + public static final String ERROR_CONF_MESSAGE = "Error.Conf.Message"; + public static final String ERROR_BIND_MESSAGE = "Error.Bind.Message"; + public static final URI HTTPS_SECURITY_LAYER_URI; + private static Log log = LogFactory.getLog(Launcher.class); + + static { + URI tmp = null; + try { + tmp = new URI("https://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue()); + } catch (URISyntaxException ex) { + log.error(ex); + } finally { + HTTPS_SECURITY_LAYER_URI = tmp; + } + } + + public static final String version; + static { + String tmp = Configurator.UNKOWN_VERSION; + try { + String bkuWebStartJar = Launcher.class.getProtectionDomain().getCodeSource().getLocation().toString(); + URL manifestURL = new URL("jar:" + bkuWebStartJar + "!/META-INF/MANIFEST.MF"); + if (log.isTraceEnabled()) { + log.trace("read version information from " + manifestURL); + } + Manifest manifest = new Manifest(manifestURL.openStream()); + Attributes atts = manifest.getMainAttributes(); + if (atts != null) { + tmp = atts.getValue("Implementation-Build"); + } + } catch (IOException ex) { + log.error("failed to read version", ex); + } finally { + version = tmp; + log.info("BKU Web Start " + version); + } + } + + private Configurator config; + private Container server; + private BasicService basicService; + + private void initStart() { + try { + basicService = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService"); + if (basicService.isOffline()) { + log.info("launching MOCCA Web Start offline"); + } else { + log.info("launching MOCCA Web Start online"); + } + } catch (UnavailableServiceException ex) { + log.info("Failed to obtain JNLP service: " + ex.getMessage()); + } + } + + private void initTrayIcon() { + log.debug("init MOCCA tray icon"); + Locale loc = Locale.getDefault(); + ResourceBundle resourceBundle; + try { + resourceBundle = ResourceBundle.getBundle( + MESSAGES_RESOURCE, loc); + } catch (MissingResourceException mx) { + resourceBundle = ResourceBundle.getBundle( + MESSAGES_RESOURCE, Locale.ENGLISH); + } + TrayIconDialog.getInstance().init(resourceBundle); + TrayIconDialog.getInstance().setShutdownHook(this); +// TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); + } + + private void initConfig() throws IOException, CodingException, GeneralSecurityException { + config = new Configurator(); + config.ensureConfiguration(); + config.ensureCertificates(); + } + + private void startServer() throws Exception { + log.info("init servlet container and MOCCA webapp"); + server = new Container(); + server.init(); + server.start(); + } + + private void initFinished() { + try { + // standalone (non-webstart) version has splashscreen + if (SplashScreen.getSplashScreen() != null) { + try { + SplashScreen.getSplashScreen().close(); + } catch (IllegalStateException ex) { + log.warn("Failed to close splash screen: " + ex.getMessage()); + } + } + if (config.isCertRenewed()) { + // don't use basicService.showDocument(), which causes a java ssl warning dialog + if (Desktop.isDesktopSupported()) { + Desktop desktop = Desktop.getDesktop(); + if (desktop.isSupported(Desktop.Action.BROWSE)) { + try { + desktop.browse(HTTPS_SECURITY_LAYER_URI); + } catch (Exception ex) { + log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URI, ex); + } + } else { + log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URI); + } + } else { + log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URI); + } + } + log.info("BKU successfully started"); + server.join(); + } catch (InterruptedException e) { + log.warn("failed to join server: " + e.getMessage(), e); + } + } + + @Override + public void shutDown() { + log.info("Shutting down server"); + if ((server != null) && (server.isRunning())) { + try { + if (server.isRunning()) { + server.stop(); + } + } catch (Exception e) { + log.debug(e.toString()); + } finally { + if (server.isRunning()) { + server.destroy(); + } + } + } + System.exit(0); + } + + public static void main(String[] args) throws InterruptedException, IOException { + + if (log.isTraceEnabled()) { + SecurityManager sm = System.getSecurityManager(); + if (sm instanceof JavaWebStartSecurity) { + System.setSecurityManager(new LogSecurityManager((JavaWebStartSecurity) sm)); + } + } + + Launcher launcher = new Launcher(); + launcher.initStart(); + launcher.initTrayIcon(); //keep reference? BKULauncher not garbage collected after main() + + try { + TrayIconDialog.getInstance().displayInfo(CONFIG_CAPTION, CONFIG_MESSAGE); + launcher.initConfig(); + } catch (Exception ex) { + log.fatal("Failed to initialize configuration", ex); + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_CONF_MESSAGE); + Thread.sleep(5000); + System.exit(-1000); + } + + try { + TrayIconDialog.getInstance().displayInfo(STARTUP_CAPTION, STARTUP_MESSAGE); + launcher.startServer(); + TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); + launcher.initFinished(); + } catch (BindException ex) { + log.fatal("Failed to launch server, " + ex.getMessage(), ex); + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); + Thread.sleep(5000); + System.exit(-1000); + } catch (MultiException ex) { + log.fatal("Failed to launch server, " + ex.getMessage(), ex); + if (ex.getThrowable(0) instanceof BindException) { + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); + } else { + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); + } + Thread.sleep(5000); + System.exit(-1000); + } catch (Exception e) { + log.fatal("Failed to launch server, " + e.getMessage(), e); + TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); + Thread.sleep(5000); + System.exit(-1000); + } + } +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java new file mode 100644 index 00000000..99fd403b --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java @@ -0,0 +1,440 @@ +/* + * 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; + +import com.sun.javaws.security.JavaWebStartSecurity; +import java.io.FileDescriptor; +import java.net.InetAddress; +import java.security.Permission; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * JVM argument -Djava.security.debug=access,failure + * (passed as attribute to java element in jnlp) is ignored. + * + * @author Clemens Orthacker + */ +public class LogSecurityManager extends SecurityManager { + + protected static final Log log = LogFactory.getLog(LogSecurityManager.class); + JavaWebStartSecurity sm; + + public LogSecurityManager(JavaWebStartSecurity sm) { + this.sm = sm; +// AppPolicy policy = AppPolicy.getInstance(); +// SecurityManager sm = System.getSecurityManager(); + } + + @Override + public void checkAccept(String host, int port) { + try { + sm.checkAccept(host, port); + } catch (SecurityException ex) { + log.warn("checkAccept(" + host + ", " + port + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkAccess(Thread g) { + try { + sm.checkAccess(g); + } catch (SecurityException ex) { + log.warn("checkAccess(" + g + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkAccess(ThreadGroup g) { + try { + sm.checkAccess(g); + } catch (SecurityException ex) { + log.warn("checkAccess(" + g + "): " + ex.getMessage(), ex); + throw ex; + } + + } + + @Override + public void checkAwtEventQueueAccess() { + try { + sm.checkAwtEventQueueAccess(); + } catch (SecurityException ex) { + log.warn("checkAwtEventQAccess():" + ex.getMessage(), ex); + throw ex; + } + + } + + @Override + public void checkConnect(String host, int port) { + try { + sm.checkConnect(host, port); + } catch (SecurityException ex) { + log.warn("checkConnect(" + host + ", " + port + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkConnect(String host, int port, Object context) { + try { + sm.checkConnect(host, port, context); + } catch (SecurityException ex) { + log.warn("checkConnect(" + host + ", " + port + ", " + context + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkCreateClassLoader() { + try { + sm.checkCreateClassLoader(); + } catch (SecurityException ex) { + log.warn("checkCreateClassLoader(): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkDelete(String file) { + try { + sm.checkDelete(file); + } catch (SecurityException ex) { + log.warn("checkDelete(" + file + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkExec(String cmd) { + try { + sm.checkExec(cmd); + } catch (SecurityException ex) { + log.warn("checkExec(" + cmd + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkExit(int status) { + try { + sm.checkExit(status); + } catch (SecurityException ex) { + log.warn("checkExit(" + status + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkLink(String lib) { + try { + sm.checkLink(lib); + } catch (SecurityException ex) { + log.warn("checkLink(" + lib + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkListen(int port) { + try { + sm.checkListen(port); + } catch (SecurityException ex) { + log.warn("checkListen(" + port + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkMemberAccess(Class clazz, int which) { + try { + sm.checkMemberAccess(clazz, which); + } catch (SecurityException ex) { + log.warn("checkMemberAccess(" + clazz + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkMulticast(InetAddress maddr) { + try { + sm.checkMulticast(maddr); + } catch (SecurityException ex) { + log.warn("checkMulticast(" + maddr + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkMulticast(InetAddress maddr, byte ttl) { + try { + sm.checkMulticast(maddr,ttl); + } catch (SecurityException ex) { + log.warn("checkMulticast(" + maddr + "," + ttl + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkPackageAccess(String pkg) { + try { + sm.checkPackageAccess(pkg); + } catch (SecurityException ex) { + log.warn("checkPackageAccess(" + pkg + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkPackageDefinition(String pkg) { + try { + sm.checkPackageDefinition(pkg); + } catch (SecurityException ex) { + log.warn("checkPackageDefinition(" + pkg + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkPermission(Permission perm) { + try { + sm.checkPermission(perm); + } catch (SecurityException ex) { + log.warn("checkPermission(" + perm.toString() + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkPermission(Permission perm, Object context) { + try { + sm.checkPermission(perm, context); + } catch (SecurityException ex) { + log.warn("checkPermission(" + perm.toString() + ", ctx): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkPrintJobAccess() { + try { + sm.checkPrintJobAccess(); + } catch (SecurityException ex) { + log.info("checkPrintJobAccess(): " + ex.getMessage(), ex); + throw ex; + } + } + + /** + * allowed + */ + @Override + public void checkPropertiesAccess() { + try { + sm.checkPropertiesAccess(); + } catch (SecurityException ex) { + log.info("checkPropertiesAccess(): " + ex.getMessage(), ex); + throw ex; + } + } + + /** + * access to all properties allowed + * @param key + */ + @Override + public void checkPropertyAccess(String key) { + try { + sm.checkPropertyAccess(key); + } catch (SecurityException ex) { + log.info("checkPropertyAccess(" + key + "): " + ex.getMessage()); + throw ex; + } + } + + @Override + public void checkRead(FileDescriptor fd) { + try { + sm.checkRead(fd); + } catch (SecurityException ex) { + log.warn("checkRead(" + fd + ") " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkRead(String file) { + try { + sm.checkRead(file); + } catch (SecurityException ex) { + log.warn("checkRead(" + file + ") " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkRead(String file, Object context) { + try { + sm.checkRead(file, context); + } catch (SecurityException ex) { + log.warn("checkRead(" + file + ") " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkSecurityAccess(String target) { + try { + sm.checkSecurityAccess(target); + } catch (SecurityException ex) { + log.info("checkSecurityAccess(" + target + "): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public void checkSetFactory() { + log.info("checkSetFactory() "); + try { + sm.checkSetFactory(); + } catch (SecurityException ex) { + log.warn("checkSetFactroy(): " + ex.getMessage(), ex); + throw ex; + } + + } + + @Override + public void checkSystemClipboardAccess() { + try { + sm.checkSystemClipboardAccess(); + } catch (SecurityException ex) { + log.info("checkSystemClipboardAccess(): " + ex.getMessage(), ex); + throw ex; + } + } + + @Override + public boolean checkTopLevelWindow(Object window) { + log.info("checkTopLevelWindow(Object window)"); + try { + return sm.checkTopLevelWindow(window); + } catch (SecurityException ex) { + log.warn("checkTopLevelWindow(" + window + "): " + ex.getMessage(), ex); + throw ex; + } + + } + + @Override + public void checkWrite(FileDescriptor fd) { + try { + sm.checkWrite(fd); + } catch (SecurityException ex) { + log.info("checkWrite(" + fd + "): " + ex.getMessage(), ex); + } + } + + @Override + public void checkWrite(String file) { + try { + sm.checkWrite(file); + } catch (SecurityException ex) { + log.info("checkWrite(" + file + "): " + ex.getMessage(), ex); + } + } + +// @Override +// protected int classDepth(String name) { +// log.info("classDepth(String name)"); return this.classDepth(name); +// } +// +// @Override +// protected int classLoaderDepth() { +// log.info("classLoaderDepth"); return sm.classLoaderDepth(); +// } +// +// @Override +// protected Object clone() throws CloneNotSupportedException { +// log.info("clone"); return sm.clone(); +// } +// +// @Override +// protected ClassLoader currentClassLoader() { +// log.info("currentClassLoader"); return sm.currentClassLoader(); +// } +// +// @Override +// protected Class currentLoadedClass() { +// log.info("currentLoadedClass"); return sm.currentLoadedClass(); +// } + @Override + public boolean equals(Object obj) { + log.info("equals"); + return sm.equals(obj); + } + +// @Override +// protected void finalize() throws Throwable { +// log.info("finalize"); sm.finalize(); +// } +// @Override +// protected Class[] getClassContext() { +// log.info("getClassContext"); return sm.getClassContext(); +// } + @Override + public boolean getInCheck() { + log.info("getInCheck"); + return sm.getInCheck(); + } + + @Override + public Object getSecurityContext() { + log.info("getSecurityContext"); + return sm.getSecurityContext(); + } + + @Override + public ThreadGroup getThreadGroup() { + log.info("getThreadGroup"); + return sm.getThreadGroup(); + } + + @Override + public int hashCode() { + log.info("hashCode"); + return sm.hashCode(); + } + +// @Override +// protected boolean inClass(String name) { +// log.info("inClass"); return sm.inClass(name); +// } +// +// @Override +// protected boolean inClassLoader() { +// log.info(""); return sm.inClassLoader(); +// } + @Override + public String toString() { + log.info("toString"); + return sm.toString(); + } +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java index 9990b2a0..fb7c40dd 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java @@ -36,7 +36,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class TrayIconDialog implements TrayIconDialogInterface { - public static final String TRAYICON_RESOURCE = "at/gv/egiz/bku/webstart/ui/trayicon.png"; + public static final String TRAYICON_RESOURCE = "at/gv/egiz/bku/webstart/ui/trayicon_32.png"; public static final String TRAYMENU_SHUTDOWN = "TrayMenu.Shutdown"; public static final String TRAYMENU_TOOLTIP = "TrayMenu.Tooltip"; diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo.png b/BKUWebStart/src/main/jnlp/resources/img/logo.png deleted file mode 100644 index 2c622d88..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_16.ico b/BKUWebStart/src/main/jnlp/resources/img/logo_16.ico new file mode 100644 index 00000000..eaedb0ad Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_16.ico differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_16.png b/BKUWebStart/src/main/jnlp/resources/img/logo_16.png new file mode 100644 index 00000000..f84f108d Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_16.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm b/BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm new file mode 100644 index 00000000..de557170 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm @@ -0,0 +1,274 @@ +/* XPM */ +static char * logo_16x16_xpm[] = { +"16 16 255 2", +" c #EDF2FA", +". c #555249", +"+ c #F3F6FC", +"@ c #ED1C24", +"# c #939698", +"$ c #FFE699", +"% c #BBAA76", +"& c #464749", +"* c #CCCCCC", +"= c #EE262D", +"- c #FCDADC", +"; c #6B6E72", +"> c #FDE4E5", +", c #D0D6DE", +"' c #968C78", +") c #848182", +"! c #535458", +"~ c #76797E", +"{ c #EE2C33", +"] c #444444", +"^ c #80848A", +"/ c #5A636E", +"( c #738974", +"_ c #ACAEB1", +": c #929F98", +"< c #47443F", +"[ c #363436", +"} c #E4ECF7", +"| c #5D5E61", +"1 c #F14C53", +"2 c #A2A3A5", +"3 c #EF333A", +"4 c #515052", +"5 c #5C685E", +"6 c #FDEAEB", +"7 c #7A7B7D", +"8 c #9FA1A4", +"9 c #FBFCFE", +"0 c #4B514D", +"a c #888A8C", +"b c #777777", +"c c #525355", +"d c #E7EEF8", +"e c #A4A9AF", +"f c #F04148", +"g c #FFF4D7", +"h c #616365", +"i c #231F20", +"j c #D4DDE9", +"k c #918F8F", +"l c #8A8E95", +"m c #F1CA3F", +"n c #B5BBC5", +"o c #F1F1F1", +"p c #9FA5AD", +"q c #363432", +"r c #888888", +"s c #FFFFFF", +"t c #7D745A", +"u c #94875D", +"v c #999999", +"w c #5F6165", +"x c #635E51", +"y c #C8C7C7", +"z c #CAD1DD", +"A c #5A5758", +"B c #C0C7D1", +"C c #9399A1", +"D c #E4C14B", +"E c #AE9B5E", +"F c #BAB9B9", +"G c #C9AE59", +"H c #767374", +"I c #D6D5D5", +"J c #DDDDDD", +"K c #666666", +"L c #E3E3E3", +"M c #ACABAB", +"N c #222222", +"O c #9E9D9D", +"P c #333333", +"Q c #EEEEEE", +"R c #BBA55C", +"S c #BBBBBB", +"T c #706A56", +"U c #3F3B3C", +"V c #A1915E", +"W c #686566", +"X c #AAB0B9", +"Y c #111111", +"Z c #444344", +"` c #897E5C", +" . c #4C494A", +".. c #669DCD", +"+. c #C6C8CA", +"@. c #555556", +"#. c #312D2E", +"$. c #5F6A78", +"%. c #6C95BC", +"&. c #D6B853", +"*. c #525962", +"=. c #636467", +"-. c #6C8AAA", +";. c #E1E2E3", +">. c #DE9E56", +",. c #70B76A", +"'. c #6C90B3", +"). c #AB875E", +"!. c #F2575D", +"~. c #B9BBBD", +"{. c #FFF1CC", +"]. c #424347", +"^. c #4A4E55", +"/. c #637183", +"(. c #ED2028", +"_. c #65778C", +":. c #688268", +"<. c #7C7F81", +"[. c #706355", +"}. c #B88E5F", +"|. c #C5945D", +"1. c #565E58", +"2. c #D9ECD4", +"3. c #72A26F", +"4. c #72AA6E", +"5. c #FBB161", +"6. c #AAAAAA", +"7. c #937A5D", +"8. c #6B84A0", +"9. c #FFEDB5", +"0. c #F1CE5D", +"a. c #FFDBB4", +"b. c #697E96", +"c. c #EAA151", +"d. c #92CD8B", +"e. c #77C371", +"f. c #7C6C59", +"g. c #719B6E", +"h. c #FCBB75", +"i. c #FFD742", +"j. c #606162", +"k. c #6C6C6E", +"l. c #E2E3E4", +"m. c #6999C5", +"n. c #D4D5D7", +"o. c #F7F9FD", +"p. c #635950", +"q. c #F0F0F1", +"r. c #FDE3E4", +"s. c #706F6D", +"t. c #FFDD6F", +"u. c #787E88", +"v. c #D6BC69", +"w. c #EEEFF0", +"x. c #63615A", +"y. c #89C982", +"z. c #AEA58E", +"A. c #F3F9F1", +"B. c #4D5056", +"C. c #6E926C", +"D. c #6C8A6A", +"E. c #E4C564", +"F. c #77A0C8", +"G. c #898169", +"H. c #FFF7EE", +"I. c #333336", +"J. c #727878", +"K. c #AE9D66", +"L. c #607160", +"M. c #6B756F", +"N. c #71B16C", +"O. c #948A6C", +"P. c #7DC479", +"Q. c #D6BA5E", +"R. c #E1F0DE", +"S. c #ADD8A4", +"T. c #6E737C", +"U. c #9E8262", +"V. c #535D54", +"W. c #7D7766", +"X. c #A1A6AD", +"Y. c #D3D4D7", +"Z. c #ADAAA6", +"`. c #B7B9BC", +" + c #C39765", +".+ c #F25E64", +"++ c #F36268", +"@+ c #769C74", +"#+ c #B69166", +"$+ c #F9FBFD", +"%+ c #FFFBFB", +"&+ c #FFE07C", +"*+ c #646B68", +"=+ c #6D6965", +"-+ c #738498", +";+ c #C8BEA3", +">+ c #C1C4C9", +",+ c #A19984", +"'+ c #E4C979", +")+ c #F1D375", +"!+ c #80C679", +"~+ c #B3B6BC", +"{+ c #8D9096", +"]+ c #9FA8A1", +"^+ c #CFD9CE", +"/+ c #FED5A9", +"(+ c #D5D9E0", +"_+ c #8D877F", +":+ c #697B6A", +"<+ c #FFFBF0", +"[+ c #E3D4AC", +"}+ c #F1CC4F", +"|+ c #FFD954", +"1+ c #C8E4C0", +"2+ c #BEE0B7", +"3+ c #D6BE73", +"4+ c #857869", +"5+ c #E5E1DC", +"6+ c #85A7CB", +"7+ c #C9B26C", +"8+ c #D4C6B5", +"9+ c #C9B67E", +"0+ c #FFE5CA", +"a+ c #FCB66B", +"b+ c #E4E4E5", +"c+ c #E3E4E5", +"d+ c #E8EBEF", +"e+ c #EBEDF0", +"f+ c #87898C", +"g+ c #B19E7E", +"h+ c #B5C2BF", +"i+ c #FDC180", +"j+ c #EE2930", +"k+ c #E4E8EE", +"l+ c #565552", +"m+ c #E4CE8D", +"n+ c #636C79", +"o+ c #A3D49B", +"p+ c #858B94", +"q+ c #84868C", +"r+ c #F1D069", +"s+ c #D2995A", +"t+ c #B8BEC6", +"u+ c #EF3B42", +"v+ c #474444", +"w+ c #E1E5EC", +"x+ c #FDFEFE", +"y+ c #FFF7E3", +"z+ c #62A1D7", +"A+ c #6DC067", +"B+ c #FAA74A", +"C+ c #FFD531", +"D+ c #E0EAF7", +"E+ c #000000", +"F+ c #FFFFFF", +" 9 _ & < K.i.u i T R C+G x C+C+", +"+.& < E C+R . q q u C+C+T G C+C+", +"i t m m T q u m m x . m . C+C+C+", +"t D t q ` m C+C+C+C+t . < G E t ", +"x . E m C+C+C+C+C+C+C+. T u E m ", +"i m C+C+C+C+C+C+C+C+m T t C+C+C+", +"< V C+C+C+C+C+m D ` q x &.C+C+C+", +"G < C+C+C+E < . i x G C+C+C+C+C+", +"C+x V E < x E &.i G C+C+C+C+C+C+", +"}+` i ` D C+C+C+x x C+C+C+C+C+C+", +". R t E C+C+C+C+G i G C+C+C+C+C+", +"l+i.m x C+C+C+C+C+< x C+C+C+C+C+", +"i 7+C+u G C+C+E < q i G C+C+C+C+", +"i x.C+C+t E < x R C+< t C+C+C+C+", +"& i '+G x x D C+C+C+E i D C+C+C+", +"_ i [ V m u C+C+C+C+D i T m u < "}; diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_32.png b/BKUWebStart/src/main/jnlp/resources/img/logo_32.png new file mode 100644 index 00000000..337b144b Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_32.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64.gif b/BKUWebStart/src/main/jnlp/resources/img/logo_64.gif new file mode 100644 index 00000000..6081d1a1 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_64.gif differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg b/BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg new file mode 100644 index 00000000..720157a5 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64.png b/BKUWebStart/src/main/jnlp/resources/img/logo_64.png new file mode 100644 index 00000000..9e9b377c Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_64.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png b/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png deleted file mode 100644 index fa6d7f96..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_64x64.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png b/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png deleted file mode 100644 index d7f8bbd0..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_90x90.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/version.xml b/BKUWebStart/src/main/jnlp/resources/img/version.xml index 715b6722..31f43441 100644 --- a/BKUWebStart/src/main/jnlp/resources/img/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/img/version.xml @@ -2,10 +2,38 @@ - logo.png + logo_16.xpm 1.0-SNAPSHOT - logo.png + logo_16.xpm + + + + logo_16.ico + 1.0-SNAPSHOT + + logo_16.ico + + + + logo_16.png + 1.0-SNAPSHOT + + logo_16.png + + + + logo_32.png + 1.0-SNAPSHOT + + logo_32.png + + + + logo_64.png + 1.0-SNAPSHOT + + logo_64.png diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 763552fc..47c17088 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,12 +2,11 @@ - BKUWebStart-1.0.5-SNAPSHOT.jar - 1.0.5-SNAPSHOT + BKUWebStart-1.0.9-SNAPSHOT.jar + 1.0.9-SNAPSHOT - BKUWebStart-1.0.5-SNAPSHOT.jar + BKUWebStart-1.0.9-SNAPSHOT.jar - utils-1.2.1-SNAPSHOT.jar @@ -15,13 +14,20 @@ utils-1.2.1-SNAPSHOT.jar + + + BKUCertificates-1.0-SNAPSHOT.jar + 1.0-SNAPSHOT + + BKUCertificates-1.0-SNAPSHOT.jar + - commons-logging-1.0.4.jar - 1.0.4 + commons-logging-1.1.1.jar + 1.1.1 - commons-logging-1.0.4.jar + commons-logging-1.1.1.jar @@ -64,17 +70,17 @@ - jetty-6.1.15.jar - 6.1.15 + jetty-6.1.19.jar + 6.1.19 - jetty-6.1.15.jar + jetty-6.1.19.jar - jetty-util-6.1.15.jar - 6.1.15 + jetty-util-6.1.19.jar + 6.1.19 - jetty-util-6.1.15.jar + jetty-util-6.1.19.jar @@ -83,6 +89,55 @@ servlet-api-2.5-20081211.jar + + + jsp-2.1-jetty-6.1.19.jar + 6.1.19 + + jsp-2.1-jetty-6.1.19.jar + + + + jsp-2.1-glassfish-9.1.1.B60.25.p0.jar + 9.1.1.B60.25.p0 + + jsp-2.1-glassfish-9.1.1.B60.25.p0.jar + + + + jsp-api-2.1-glassfish-9.1.1.B60.25.p0.jar + 9.1.1.B60.25.p0 + + jsp-api-2.1-glassfish-9.1.1.B60.25.p0.jar + + + + ant-1.6.5.jar + 1.6.5 + + ant-1.6.5.jar + + + + core-3.1.1.jar + 3.1.1 + + core-3.1.1.jar + + + + slf4j-api-1.5.8.jar + 1.5.8 + + slf4j-api-1.5.8.jar + + + + slf4j-log4j12-1.5.8.jar + 1.5.8 + + slf4j-log4j12-1.5.8.jar + diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml new file mode 100644 index 00000000..9135ba1b --- /dev/null +++ b/BKUWebStart/src/main/jnlp/template-local.xml @@ -0,0 +1,42 @@ + + + + + + $project.Description + + E-Government Innovationszentrum (EGIZ) + + $project.Description (BKU) MOCCA Web Start + $project.Description + + + + + + + + + + +#if($offlineAllowed) + +#end + + + +#if($allPermissions) + + + +#end + + + + + + $dependencies + + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index a6f6d96e..0176376a 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -4,12 +4,16 @@ $project.Description - $project.Organization.Name + + E-Government Innovationszentrum (EGIZ) - $project.Description + $project.Description (BKU) MOCCA Web Start $project.Description - - + + + + + @@ -20,23 +24,23 @@ #end - - + #if($allPermissions) #end + + - + $dependencies - - + $dependencies diff --git a/BKUWebStart/src/main/jnlp/template_dev.xml b/BKUWebStart/src/main/jnlp/template_dev.xml deleted file mode 100644 index 2d8e8133..00000000 --- a/BKUWebStart/src/main/jnlp/template_dev.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - $project.Name - $project.Organization.Name - - $project.Description - $project.Description - - - - - - - -#if($offlineAllowed) - -#end - - - - -#if($allPermissions) - - - -#end - - - - - - - $dependencies - - - - \ No newline at end of file diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip new file mode 100644 index 00000000..1df56e5c Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip deleted file mode 100644 index 74465445..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/configuration.zip and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties index eb2b74c0..bf4e5b8a 100644 --- a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties +++ b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties @@ -1,11 +1,13 @@ #-------- tray icon messages ------- -TrayMenu.Tooltip=B\u00FCrgerkartenumgebung (MOCCA Web Start) +TrayMenu.Tooltip=B\u00FCrgerkartenumgebung TrayMenu.Shutdown=B\u00FCrgerkartenumgebung beenden +Config.Message=Zertifikate werden geladen +Config.Caption=B\u00FCrgerkartenumgebung Startup.Message=B\u00FCrgerkartenumgebung wird gestartet... -Startup.Caption=B\u00FCrgerkartenumgebung (MOCCA Web Start) +Startup.Caption=B\u00FCrgerkartenumgebung Greetings.Message=B\u00FCrgerkartenumgebung erfolgreich gestartet -Greetings.Caption=B\u00FCrgerkartenumgebung (MOCCA Web Start) +Greetings.Caption=B\u00FCrgerkartenumgebung Error.Caption=Fehler Error.Startup.Message=B\u00FCrgerkartenumgebung konnte nicht gestartet werden Error.Conf.Message=Konfiguration konnte nicht initialisiert werden, B\u00FCrberkartenumgebung wird nicht gestartet diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png deleted file mode 100644 index 2c622d88..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png new file mode 100644 index 00000000..f84f108d Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png new file mode 100644 index 00000000..2c622d88 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png differ diff --git a/BKUWebStart/src/main/resources/log4j.properties b/BKUWebStart/src/main/resources/log4j.properties index 4df33ab5..76de3576 100644 --- a/BKUWebStart/src/main/resources/log4j.properties +++ b/BKUWebStart/src/main/resources/log4j.properties @@ -1,5 +1,24 @@ +# 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. + # loglever DEBUG, appender STDOUT -log4j.rootLogger=TRACE, STDOUT, file +log4j.rootLogger=DEBUG, file +log4j.logger.org.mortbay.log=INFO +log4j.logger.pki=INFO + +log4j.additivity.pki=false # STDOUT appender log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender @@ -13,4 +32,4 @@ log4j.appender.file=org.apache.log4j.DailyRollingFileAppender log4j.appender.file.datePattern='.'yyyy-MM-dd log4j.appender.file.File=${user.home}/.mocca/logs/webstart.log log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n \ No newline at end of file +log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1}:%L - %m%n \ No newline at end of file -- cgit v1.2.3 From fe103510aabea195b66bf222d87fd5dfd7a64041 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 13 Aug 2009 09:23:32 +0000 Subject: [#433] update BKU Web Start CertStore WebStart configuration refactored git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@424 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- BKUWebStart/src/main/jnlp/resources/version.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index a8e33a58..79f4925f 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -14,7 +14,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.0.9-SNAPSHOT + 1.0.10-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 47c17088..67b319ca 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,10 +2,10 @@ - BKUWebStart-1.0.9-SNAPSHOT.jar - 1.0.9-SNAPSHOT + BKUWebStart-1.0.10-SNAPSHOT.jar + 1.0.10-SNAPSHOT - BKUWebStart-1.0.9-SNAPSHOT.jar + BKUWebStart-1.0.10-SNAPSHOT.jar -- cgit v1.2.3 From 9ded73fe9608105cca51239793a2f5039894e5c7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 13 Aug 2009 09:30:25 +0000 Subject: BKULocal-1.0.10-SNAPSHOT git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@427 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 79f4925f..f687a794 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -237,7 +237,7 @@ at.gv.egiz BKULocal - 1.0.6-SNAPSHOT + 1.0.10-SNAPSHOT war -- cgit v1.2.3 From a8e021a5b4450e117b76d9f6cc69bd24cd1dd5d3 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 10:55:59 +0000 Subject: fixed updateRequired function git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@434 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/webstart/Configurator.java | 159 ++++++++++++------- .../java/at/gv/egiz/bku/webstart/Container.java | 4 + .../at/gv/egiz/bku/webstart/conf/conf.zip | Bin 2944 -> 3005 bytes BKUWebStart/src/main/resources/log4j.properties | 2 +- .../at/gv/egiz/bku/webstart/ConfiguratorTest.java | 175 +++++++++++++++++++++ .../src/test/resources/commons-logging.properties | 1 + BKUWebStart/src/test/resources/log4j.properties | 35 +++++ 7 files changed, 320 insertions(+), 56 deletions(-) create mode 100644 BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java create mode 100644 BKUWebStart/src/test/resources/commons-logging.properties create mode 100644 BKUWebStart/src/test/resources/log4j.properties (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java index ab1746ed..f1349637 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java @@ -79,7 +79,7 @@ public class Configurator { public static final String PASSWD_FILE = ".secret"; private static final Log log = LogFactory.getLog(Configurator.class); - + /** currently installed configuration version */ private String version; private String certsVersion; @@ -104,7 +104,7 @@ public class Configurator { if (log.isDebugEnabled()) { log.debug("config directory " + configDir + ", version " + version); } - if (updateRequired(version)) { + if (updateRequired(version, MIN_CONFIG_VERSION)) { File moccaDir = configDir.getParentFile(); File zipFile = new File(moccaDir, "conf-" + version + ".zip"); ZipOutputStream zipOS = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile))); @@ -135,7 +135,7 @@ public class Configurator { log.debug("certificate-store directory " + certsDir + ", version " + certsVersion); } String newCertsVersion = getCertificatesVersion(); - if (updateRequiredStrict(certsVersion, newCertsVersion)) { + if (updateRequired(certsVersion, newCertsVersion)) { File moccaDir = certsDir.getParentFile(); File zipFile = new File(moccaDir, "certs-" + certsVersion + ".zip"); ZipOutputStream zipOS = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile))); @@ -174,7 +174,7 @@ public class Configurator { String version; while ((version = versionReader.readLine().trim()) != null) { if (version.length() > 0 && !version.startsWith("#")) { - log.debug("configuration version from " + versionFile + ": " + version); + log.trace("configuration version from " + versionFile + ": " + version); return version; } } @@ -221,70 +221,119 @@ public class Configurator { return certsResourceVersion; } - protected static boolean updateRequired(String oldVersion) { - log.debug("comparing " + oldVersion + " to " + MIN_CONFIG_VERSION); - if (oldVersion != null && !UNKOWN_VERSION.equals(oldVersion)) { - - int majorEnd = oldVersion.indexOf('-'); - String oldMajor = (majorEnd < 0) ? oldVersion : oldVersion.substring(0, majorEnd); - - String minMajor = MIN_CONFIG_VERSION; - boolean releaseRequired = true; - if (MIN_CONFIG_VERSION.endsWith("-SNAPSHOT")) { - releaseRequired = false; - minMajor = minMajor.substring(0, minMajor.length() - 9); - } - - int compare = oldMajor.compareTo(minMajor); - if (compare < 0 || - // SNAPSHOT versions are pre-releases (update if release required) - (compare == 0 && releaseRequired && oldVersion.startsWith("-SNAPSHOT", majorEnd))) { - log.debug("configuration update required"); - return true; - } else { - log.debug("configuration up to date"); - return false; - } - } - log.debug("no old version, configuration update required"); - return true; - } - /** * if unknown old, update in any case - * if known old and unknown new, don't update + * if known old and unknown min, don't update * @param oldVersion - * @param newVersion + * @param minVersion * @return */ - private boolean updateRequiredStrict(String oldVersion, String newVersion) { - log.debug("comparing " + oldVersion + " to " + newVersion); + protected static boolean updateRequired(String oldVersion, String minVersion) { + log.debug("comparing " + oldVersion + " to " + minVersion); if (oldVersion != null && !UNKOWN_VERSION.equals(oldVersion)) { - if (newVersion != null && !UNKOWN_VERSION.equals(newVersion)) { - String[] oldV = oldVersion.split("-"); - String[] newV = newVersion.split("-"); - log.trace("comparing " + oldV[0] + " to " + newV[0]); - if (oldV[0].compareTo(newV[0]) < 0) { - log.debug("update required"); - return true; - } else { - log.trace("comparing " + oldV[oldV.length - 1] + " to " + newV[newV.length - 1]); - if (oldV[oldV.length - 1].compareTo(newV[newV.length - 1]) < 0) { + if (minVersion != null && !UNKOWN_VERSION.equals(minVersion)) { + int fromInd = 0; + int nextIndOld, nextIndMin; + int xOld, xMin; + + // assume dots '.' appear in major version only (not after "-SNAPSHOT") + while ((nextIndOld = oldVersion.indexOf('.', fromInd)) > 0) { + nextIndMin = minVersion.indexOf('.', fromInd); + if (nextIndMin < 0) { + log.debug("installed version newer than minimum required (newer minor version)"); + } + xOld = Integer.valueOf(oldVersion.substring(fromInd, nextIndOld)); + xMin = Integer.valueOf(minVersion.substring(fromInd, nextIndMin)); + if (xMin > xOld) { log.debug("update required"); return true; - } else { - log.debug("no update required"); + } else if (xMin < xOld) { + log.debug("installed version newer than minimum required"); return false; } + fromInd = nextIndOld + 1; + } + + // compare last digit of major + boolean preRelease = true; + int majorEndOld = oldVersion.indexOf("-SNAPSHOT"); + if (majorEndOld < 0) { + preRelease = false; + majorEndOld = oldVersion.length(); + } + + boolean releaseRequired = false; + int majorEndMin = minVersion.indexOf("-SNAPSHOT"); + if (majorEndMin < 0) { + releaseRequired = true; + majorEndMin = minVersion.length(); + } + + xOld = Integer.valueOf(oldVersion.substring(fromInd, majorEndOld)); + boolean hasMoreDigitsMin = true; + nextIndMin = minVersion.indexOf('.', fromInd); + if (nextIndMin < 0) { + hasMoreDigitsMin = false; + nextIndMin = majorEndMin; + } + xMin = Integer.valueOf(minVersion.substring(fromInd, nextIndMin)); + if (xMin > xOld) { + log.debug("update required"); + return true; + } else if (xMin < xOld) { + log.debug("installed version newer than minimum required"); + return false; + } else if (hasMoreDigitsMin) { // xMin == xOld + log.debug("update required (newer minor version required)"); + return true; + } else if (preRelease && releaseRequired) { + log.debug("pre-release installed but release required"); + return true; + } else { + log.debug("exact match, no updated required"); + return false; } } - log.debug("unknown new version, do not update"); - return true; + log.debug("unknown minimum version, do not update"); + return false; } - log.debug("unknown old version, update required"); + log.debug("no old version, update required"); return true; } - + + /** + + * @param oldVersion + * @param newVersion + * @return + */ +// private boolean updateRequiredStrict(String oldVersion, String newVersion) { +// log.debug("comparing " + oldVersion + " to " + newVersion); +// if (oldVersion != null && !UNKOWN_VERSION.equals(oldVersion)) { +// if (newVersion != null && !UNKOWN_VERSION.equals(newVersion)) { +// String[] oldV = oldVersion.split("-"); +// String[] newV = newVersion.split("-"); +// log.trace("comparing " + oldV[0] + " to " + newV[0]); +// if (oldV[0].compareTo(newV[0]) < 0) { +// log.debug("update required"); +// return true; +// } else { +// log.trace("comparing " + oldV[oldV.length - 1] + " to " + newV[newV.length - 1]); +// if (oldV[oldV.length - 1].compareTo(newV[newV.length - 1]) < 0) { +// log.debug("update required"); +// return true; +// } else { +// log.debug("no update required"); +// return false; +// } +// } +// } +// log.debug("unknown new version, do not update"); +// return true; +// } +// log.debug("unknown old version, update required"); +// return true; +// } protected static void backupAndDelete(File dir, URI relativeTo, ZipOutputStream zip) throws IOException { if (dir.isDirectory()) { File[] subDirs = dir.listFiles(); @@ -320,7 +369,7 @@ public class Configurator { private static void createConfig(File configDir, String version) throws IOException { if (log.isDebugEnabled()) { - log.debug("creating configuration version " + Launcher.version + " in " + configDir ); + log.debug("creating configuration version " + Launcher.version + " in " + configDir); } configDir.mkdirs(); File confTemplateFile = new File(configDir, CONF_TEMPLATE_FILE); @@ -347,7 +396,7 @@ public class Configurator { if (certsURL != null) { StringBuilder url = new StringBuilder(certsURL.toExternalForm()); url = url.replace(url.length() - CERTIFICATES_PKG.length(), url.length(), "META-INF/MANIFEST.MF"); - log.debug("retrieve certificate resource names from " + url); + log.trace("retrieve certificate resource names from " + url); certsURL = new URL(url.toString()); Manifest certsManifest = new Manifest(certsURL.openStream()); certsDir.mkdirs(); diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index 4df90ab2..a2947833 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -177,7 +177,11 @@ public class Container { perms.add(new FilePermission(new File(System.getProperty("user.home")).getAbsolutePath(), "read, write")); perms.add(new FilePermission(new File(System.getProperty("user.home") + "/-").getAbsolutePath(), "read, write")); perms.add(new FilePermission(new File(System.getProperty("user.home") + "/.mocca/logs/*").getAbsolutePath(), "read, write,delete")); + perms.add(new FilePermission(new File(System.getProperty("user.home") + "/.mocca/certs/-").getAbsolutePath(), "read, write,delete")); + //TODO + log.trace("granting file read/write permission to MOCCA local"); + perms.add(new FilePermission("<>", "read, write")); return perms; } diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip index 1df56e5c..7ed90b7b 100644 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip differ diff --git a/BKUWebStart/src/main/resources/log4j.properties b/BKUWebStart/src/main/resources/log4j.properties index 76de3576..76562ccf 100644 --- a/BKUWebStart/src/main/resources/log4j.properties +++ b/BKUWebStart/src/main/resources/log4j.properties @@ -18,7 +18,7 @@ log4j.rootLogger=DEBUG, file log4j.logger.org.mortbay.log=INFO log4j.logger.pki=INFO -log4j.additivity.pki=false +#log4j.additivity.pki=false # STDOUT appender log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender diff --git a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java new file mode 100644 index 00000000..0c08a276 --- /dev/null +++ b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java @@ -0,0 +1,175 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.bku.webstart; + +import java.io.File; +import java.net.URI; +import java.util.zip.ZipOutputStream; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author clemens + */ +public class ConfiguratorTest { + + + public ConfiguratorTest() { + } + + @BeforeClass + public static void setUpClass() throws Exception { + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + /** + * Test of ensureConfiguration method, of class Configurator. + */ + @Ignore + @Test + public void testEnsureConfiguration() throws Exception { + System.out.println("ensureConfiguration"); + Configurator instance = new Configurator(); + instance.ensureConfiguration(); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of ensureCertificates method, of class Configurator. + */ + @Ignore + @Test + public void testEnsureCertificates() throws Exception { + System.out.println("ensureCertificates"); + Configurator instance = new Configurator(); + instance.ensureCertificates(); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of isCertRenewed method, of class Configurator. + */ + @Ignore + @Test + public void testIsCertRenewed() { + System.out.println("isCertRenewed"); + Configurator instance = new Configurator(); + boolean expResult = false; + boolean result = instance.isCertRenewed(); + assertEquals(expResult, result); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of readVersion method, of class Configurator. + */ + @Ignore + @Test + public void testReadVersion() { + System.out.println("readVersion"); + File versionFile = null; + String expResult = ""; + String result = Configurator.readVersion(versionFile); + assertEquals(expResult, result); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of updateRequired method, of class Configurator. + */ + @Test + public void testUpdateRequired() { + System.out.println("updateRequired"); + String oldVersion = "1.0.9-SNAPSHOT-r123"; + String minVersion = "1.0.9-SNAPSHOT"; + boolean expResult = false; + boolean result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-SNAPSHOT-r123"; + minVersion = "1.0.9"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-SNAPSHOT-r123"; + minVersion = "1.0.10-SNAPSHOT"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9"; + minVersion = "1.0.9.1-SNAPSHOT"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9"; + minVersion = "1.0.8.99-SNAPSHOT"; + expResult = false; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1"; + minVersion = "2"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + } + + /** + * Test of backupAndDelete method, of class Configurator. + */ + @Ignore + @Test + public void testBackupAndDelete() throws Exception { + System.out.println("backupAndDelete"); + File dir = null; + URI relativeTo = null; + ZipOutputStream zip = null; + Configurator.backupAndDelete(dir, relativeTo, zip); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of initConfig method, of class Configurator. + */ + @Ignore + @Test + public void testInitConfig() throws Exception { + System.out.println("initConfig"); + File configDir = null; + Configurator instance = new Configurator(); + instance.initConfig(configDir); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + +} \ No newline at end of file diff --git a/BKUWebStart/src/test/resources/commons-logging.properties b/BKUWebStart/src/test/resources/commons-logging.properties new file mode 100644 index 00000000..29292562 --- /dev/null +++ b/BKUWebStart/src/test/resources/commons-logging.properties @@ -0,0 +1 @@ +org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger diff --git a/BKUWebStart/src/test/resources/log4j.properties b/BKUWebStart/src/test/resources/log4j.properties new file mode 100644 index 00000000..ea08c51d --- /dev/null +++ b/BKUWebStart/src/test/resources/log4j.properties @@ -0,0 +1,35 @@ +# 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. + +# loglever DEBUG, appender STDOUT +log4j.rootLogger=TRACE, STDOUT +log4j.logger.org.mortbay.log=INFO +log4j.logger.pki=INFO + +#log4j.additivity.pki=false + +# STDOUT appender +log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender +log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout +#log4j.appender.STDOUT.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n +#log4j.appender.STDOUT.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n +log4j.appender.STDOUT.layout.ConversionPattern=%-5p |%d | %t | %c %x- %m%n + +### FILE appender +log4j.appender.file=org.apache.log4j.DailyRollingFileAppender +log4j.appender.file.datePattern='.'yyyy-MM-dd +log4j.appender.file.File=${user.home}/.mocca/logs/webstart.log +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1}:%L - %m%n \ No newline at end of file -- cgit v1.2.3 From df55caa03b0111d81b44762936462ca29d229c7e Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 10:59:28 +0000 Subject: <> git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@435 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index a2947833..4ae3b060 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -181,7 +181,7 @@ public class Container { //TODO log.trace("granting file read/write permission to MOCCA local"); - perms.add(new FilePermission("<>", "read, write")); + perms.add(new FilePermission("<>", "read, write")); return perms; } -- cgit v1.2.3 From 3125332260699b8ffd28188c9038cc106c4751d6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 11:34:30 +0000 Subject: RELEASE VERSIONs (not updated by maven release plugin) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@437 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/src/main/jnlp/resources/version.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 67b319ca..013194a4 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,24 +2,24 @@ - BKUWebStart-1.0.10-SNAPSHOT.jar - 1.0.10-SNAPSHOT + BKUWebStart-1.0.10.jar + 1.0.10 - BKUWebStart-1.0.10-SNAPSHOT.jar + BKUWebStart-1.0.10.jar - utils-1.2.1-SNAPSHOT.jar - 1.2.1-SNAPSHOT + utils-1.2.1.jar + 1.2.1 - utils-1.2.1-SNAPSHOT.jar + utils-1.2.1.jar - BKUCertificates-1.0-SNAPSHOT.jar - 1.0-SNAPSHOT + BKUCertificates-1.0.jar + 1.0 - BKUCertificates-1.0-SNAPSHOT.jar + BKUCertificates-1.0.jar -- cgit v1.2.3 From ea78ccdee3806232a008e6187cfdcc12bd277182 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 12:42:39 +0000 Subject: don't depend on SNAPSHOT versions git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@439 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index f687a794..67d0bc8e 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -188,7 +188,7 @@ webstart-maven-plugin org.codehaus.mojo.webstart - 1.0-beta-1-SNAPSHOT + 1.0-beta-1-mocca NONE -- cgit v1.2.3 From fa928f387d17cb9658dd6f488c619cfcceab9801 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 13:05:44 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@440 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 67d0bc8e..368b6f92 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -1,9 +1,8 @@ - bku at.gv.egiz - 1.2.1-SNAPSHOT + 1.2.1 4.0.0 at.gv.egiz @@ -14,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.0.10-SNAPSHOT + 1.0.10 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -195,7 +194,7 @@ PKCS11 iaik.pkcs.pkcs11.provider.IAIKPkcs11 a-sit - + true false @@ -237,18 +236,18 @@ at.gv.egiz BKULocal - 1.0.10-SNAPSHOT + 1.0.10 war at.gv.egiz BKUCertificates - 1.0-SNAPSHOT + 1.0 utils at.gv.egiz - 1.2.1-SNAPSHOT + 1.2.1 iaik_ecc_signed @@ -299,4 +298,4 @@ ${java.home}/lib/javaws.jar - + \ No newline at end of file -- cgit v1.2.3 From a4e2fb04ca7e5e2bf2352c0881bb686cb83aaf74 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 13:06:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@442 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 368b6f92..2de61fdc 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,7 +2,7 @@ bku at.gv.egiz - 1.2.1 + 1.2.2-SNAPSHOT 4.0.0 at.gv.egiz @@ -13,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.0.10 + 1.0.11-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -236,7 +236,7 @@ at.gv.egiz BKULocal - 1.0.10 + 1.0.11-SNAPSHOT war @@ -247,7 +247,7 @@ utils at.gv.egiz - 1.2.1 + 1.2.2-SNAPSHOT iaik_ecc_signed -- cgit v1.2.3 From e72c9994054446f38c5bc53d7da573e366f57963 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 19 Aug 2009 13:43:02 +0000 Subject: make "include-webstart" profile default (added "local-webstart" for development) updateRequired (versioning) bug fixed AboutDialog Branding (removed MOCCA/Bean) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@444 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 36 ++-- .../java/at/gv/egiz/bku/webstart/Configurator.java | 55 +----- .../java/at/gv/egiz/bku/webstart/Container.java | 2 +- .../java/at/gv/egiz/bku/webstart/Launcher.java | 208 +++++++++++++-------- .../at/gv/egiz/bku/webstart/gui/AboutDialog.form | 139 ++++++++++++++ .../at/gv/egiz/bku/webstart/gui/AboutDialog.java | 162 ++++++++++++++++ .../bku/webstart/gui/BKUControllerInterface.java | 23 +++ .../gv/egiz/bku/webstart/gui/TrayMenuListener.java | 75 ++++++++ .../bku/webstart/ui/BKUControllerInterface.java | 23 --- .../at/gv/egiz/bku/webstart/ui/TrayIconDialog.java | 205 -------------------- .../bku/webstart/ui/TrayIconDialogInterface.java | 33 ---- .../src/main/jnlp/resources/img/logo_24.png | Bin 0 -> 1982 bytes BKUWebStart/src/main/jnlp/resources/img/splash.png | Bin 54978 -> 41455 bytes .../src/main/jnlp/resources/img/version.xml | 32 +--- BKUWebStart/src/main/jnlp/template-local.xml | 2 + BKUWebStart/src/main/jnlp/template.xml | 8 +- .../resources/at/gv/egiz/bku/webstart/logo_24.png | Bin 0 -> 1982 bytes .../resources/at/gv/egiz/bku/webstart/logo_32.png | Bin 0 -> 3228 bytes .../at/gv/egiz/bku/webstart/logo_notext.png | Bin 0 -> 3291 bytes .../at/gv/egiz/bku/webstart/messages.properties | 35 ++++ .../resources/at/gv/egiz/bku/webstart/splash.png | Bin 0 -> 41455 bytes .../gv/egiz/bku/webstart/ui/UIMessages.properties | 20 -- .../at/gv/egiz/bku/webstart/ui/favicon.png | Bin 2149 -> 0 bytes .../at/gv/egiz/bku/webstart/ui/trayicon_16.png | Bin 1084 -> 0 bytes .../at/gv/egiz/bku/webstart/ui/trayicon_32.png | Bin 2609 -> 0 bytes BKUWebStart/src/main/resources/logo_32x32.png | Bin 1522 -> 0 bytes BKUWebStart/src/main/resources/logo_90x90.png | Bin 3294 -> 0 bytes BKUWebStart/src/main/resources/logo_RGB22x22.png | Bin 1751 -> 0 bytes BKUWebStart/src/main/resources/logo_RGB32x32.png | Bin 2609 -> 0 bytes .../src/main/resources/splash_standalone.png | Bin 54978 -> 0 bytes .../at/gv/egiz/bku/webstart/ConfiguratorTest.java | 24 +++ 31 files changed, 630 insertions(+), 452 deletions(-) create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/BKUControllerInterface.java create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/TrayMenuListener.java delete mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java delete mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java delete mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java create mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_24.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages.properties create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/splash.png delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png delete mode 100644 BKUWebStart/src/main/resources/logo_32x32.png delete mode 100644 BKUWebStart/src/main/resources/logo_90x90.png delete mode 100644 BKUWebStart/src/main/resources/logo_RGB22x22.png delete mode 100644 BKUWebStart/src/main/resources/logo_RGB32x32.png delete mode 100644 BKUWebStart/src/main/resources/splash_standalone.png (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 2de61fdc..03f5f5f3 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -43,18 +43,6 @@ false ${project.build.directory}/classes - true @@ -89,8 +77,8 @@ lib ${project.basedir}/src/main/jnlp - template-local.xml - mocca-local.jnlp + template.xml + mocca.jnlp at.gv.egiz.bku.webstart.Launcher 1.6+ true @@ -111,7 +99,7 @@ false - false + true true true @@ -165,18 +153,19 @@ true - at.gv.egiz.bku.webstart.BKULauncher + at.gv.egiz.bku.webstart.Launcher development ${pom.url} - splash_standalone.png + at/gv/egiz/bku/webstart/splash.png + @@ -211,7 +200,8 @@ - include-webstart + + local-webstart @@ -219,12 +209,10 @@ org.codehaus.mojo.webstart - template.xml - mocca.jnlp + template-local.xml + mocca-local.jnlp - false - - true + false @@ -298,4 +286,4 @@ ${java.home}/lib/javaws.jar - \ No newline at end of file + diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java index f1349637..bef2246b 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java @@ -18,7 +18,6 @@ package at.gv.egiz.bku.webstart; import at.gv.egiz.bku.utils.StreamUtil; import iaik.asn1.CodingException; -import iaik.xml.crypto.utils.Utils; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; @@ -32,25 +31,19 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; -import java.net.URISyntaxException; import java.net.URL; import java.security.GeneralSecurityException; import java.security.KeyStore; import java.util.Enumeration; import java.util.Iterator; -import java.util.Map; -import java.util.Set; import java.util.UUID; import java.util.jar.Attributes; import java.util.jar.Manifest; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.eclipse.jdt.core.dom.ThisExpression; /** * @@ -63,7 +56,7 @@ public class Configurator { * configurations with less than this (major) version will be backuped and updated * allowed: MAJOR[.MINOR[.X[-SNAPSHOT]]] */ - public static final String MIN_CONFIG_VERSION = "1.0.9-SNAPSHOT"; + public static final String MIN_CONFIG_VERSION = "1.0.9"; public static final String CONFIG_DIR = ".mocca/conf/"; public static final String CERTS_DIR = ".mocca/certs/"; public static final String VERSION_FILE = ".version"; @@ -259,14 +252,20 @@ public class Configurator { int majorEndOld = oldVersion.indexOf("-SNAPSHOT"); if (majorEndOld < 0) { preRelease = false; - majorEndOld = oldVersion.length(); + majorEndOld = oldVersion.indexOf('-'); // 1.0.10-r439 + if (majorEndOld < 0) { + majorEndOld = oldVersion.length(); + } } boolean releaseRequired = false; int majorEndMin = minVersion.indexOf("-SNAPSHOT"); if (majorEndMin < 0) { releaseRequired = true; - majorEndMin = minVersion.length(); + majorEndMin = minVersion.indexOf('-'); + if (majorEndMin < 0) { + majorEndMin = minVersion.length(); + } } xOld = Integer.valueOf(oldVersion.substring(fromInd, majorEndOld)); @@ -301,39 +300,6 @@ public class Configurator { return true; } - /** - - * @param oldVersion - * @param newVersion - * @return - */ -// private boolean updateRequiredStrict(String oldVersion, String newVersion) { -// log.debug("comparing " + oldVersion + " to " + newVersion); -// if (oldVersion != null && !UNKOWN_VERSION.equals(oldVersion)) { -// if (newVersion != null && !UNKOWN_VERSION.equals(newVersion)) { -// String[] oldV = oldVersion.split("-"); -// String[] newV = newVersion.split("-"); -// log.trace("comparing " + oldV[0] + " to " + newV[0]); -// if (oldV[0].compareTo(newV[0]) < 0) { -// log.debug("update required"); -// return true; -// } else { -// log.trace("comparing " + oldV[oldV.length - 1] + " to " + newV[newV.length - 1]); -// if (oldV[oldV.length - 1].compareTo(newV[newV.length - 1]) < 0) { -// log.debug("update required"); -// return true; -// } else { -// log.debug("no update required"); -// return false; -// } -// } -// } -// log.debug("unknown new version, do not update"); -// return true; -// } -// log.debug("unknown old version, update required"); -// return true; -// } protected static void backupAndDelete(File dir, URI relativeTo, ZipOutputStream zip) throws IOException { if (dir.isDirectory()) { File[] subDirs = dir.listFiles(); @@ -454,8 +420,7 @@ public class Configurator { passwdWriter.write(password); passwdWriter.close(); if (!passwdFile.setReadable(false, false) || !passwdFile.setReadable(true, true)) { - passwdFile.delete(); - throw new IOException("failed to make " + passwdFile + " owner readable only, deleting file"); + log.error("failed to make " + passwdFile + " owner readable only (certain file-systems do not support owner's permissions)"); } TLSServerCA ca = new TLSServerCA(); KeyStore ks = ca.generateKeyStore(password); diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index 4ae3b060..08a0808a 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -151,7 +151,7 @@ public class Container { perms.add(new RuntimePermission("getClassLoader")); // standard permissions - perms.add(new PropertyPermission("*", "read")); + perms.add(new PropertyPermission("*", "read,write")); perms.add(new RuntimePermission("accessDeclaredMembers")); perms.add(new RuntimePermission("accessClassInPackage.*")); perms.add(new RuntimePermission("defineClassInPackage.*")); 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 f7be7b65..23d832a2 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,27 +1,33 @@ package at.gv.egiz.bku.webstart; +import at.gv.egiz.bku.webstart.gui.BKUControllerInterface; +import at.gv.egiz.bku.webstart.gui.TrayMenuListener; import iaik.asn1.CodingException; import java.io.IOException; import java.net.URISyntaxException; import java.util.Locale; -import java.util.MissingResourceException; import java.util.ResourceBundle; import javax.jnlp.UnavailableServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import at.gv.egiz.bku.webstart.ui.BKUControllerInterface; -import at.gv.egiz.bku.webstart.ui.TrayIconDialog; import com.sun.javaws.security.JavaWebStartSecurity; +import java.awt.AWTException; import java.awt.Desktop; +import java.awt.Image; +import java.awt.MenuItem; +import java.awt.PopupMenu; import java.awt.SplashScreen; +import java.awt.SystemTray; +import java.awt.TrayIcon; import java.net.BindException; import java.net.URI; import java.net.URL; import java.security.GeneralSecurityException; import java.util.jar.Attributes; import java.util.jar.Manifest; +import javax.imageio.ImageIO; import javax.jnlp.BasicService; import javax.jnlp.ServiceManager; import org.mortbay.util.MultiException; @@ -31,18 +37,26 @@ public class Launcher implements BKUControllerInterface { public static final String WEBAPP_RESOURCE = "BKULocal.war"; public static final String CERTIFICATES_RESOURCE = "BKUCertificates.jar"; public static final String WEBAPP_FILE = "BKULocal.war"; - public static final String MESSAGES_RESOURCE = "at/gv/egiz/bku/webstart/ui/UIMessages"; + public static final String MESSAGES_RESOURCE = "at/gv/egiz/bku/webstart/messages"; + public static final String TRAYICON_RESOURCE = "at/gv/egiz/bku/webstart/logo_"; /** resource bundle messages */ - public static final String GREETING_CAPTION = "Greetings.Caption"; - public static final String GREETING_MESSAGE = "Greetings.Message"; - public static final String CONFIG_CAPTION = "Config.Caption"; - public static final String CONFIG_MESSAGE = "Config.Message"; - public static final String STARTUP_CAPTION = "Startup.Caption"; - public static final String STARTUP_MESSAGE = "Startup.Message"; - public static final String ERROR_CAPTION = "Error.Caption"; - public static final String ERROR_STARTUP_MESSAGE = "Error.Startup.Message"; - public static final String ERROR_CONF_MESSAGE = "Error.Conf.Message"; - public static final String ERROR_BIND_MESSAGE = "Error.Bind.Message"; + public static final String CAPTION_DEFAULT = "tray.caption.default"; + public static final String CAPTION_ERROR = "tray.caption.error"; + public static final String MESSAGE_START = "tray.message.start"; + public static final String MESSAGE_START_OFFLINE = "tray.message.start.offline"; + public static final String MESSAGE_CONFIG = "tray.message.config"; + public static final String MESSAGE_CERTS = "tray.message.certs"; + public static final String MESSAGE_FINISHED = "tray.message.finished"; + public static final String MESSAGE_SHUTDOWN = "tray.message.shutdown"; + 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 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; private static Log log = LogFactory.getLog(Launcher.class); @@ -56,7 +70,6 @@ public class Launcher implements BKUControllerInterface { HTTPS_SECURITY_LAYER_URI = tmp; } } - public static final String version; static { String tmp = Configurator.UNKOWN_VERSION; @@ -78,16 +91,107 @@ public class Launcher implements BKUControllerInterface { log.info("BKU Web Start " + version); } } - private Configurator config; private Container server; private BasicService basicService; + private TrayIcon trayIcon; + private ResourceBundle messages; + + public Launcher() { + if (log.isTraceEnabled()) { + SecurityManager sm = System.getSecurityManager(); + if (sm instanceof JavaWebStartSecurity) { + System.setSecurityManager(new LogSecurityManager((JavaWebStartSecurity) sm)); + } + } + messages = ResourceBundle.getBundle(MESSAGES_RESOURCE, Locale.getDefault()); + trayIcon = initTrayIcon(); + } + + public void launch() throws Exception { + initStart(); + try { + initConfig(); + } catch (Exception ex) { + log.fatal("Failed to initialize configuration", ex); + trayIcon.displayMessage(messages.getString(CAPTION_ERROR), + messages.getString(ERROR_CONFIG), TrayIcon.MessageType.ERROR); + throw ex; + } + try { + startServer(); + initFinished(); + } catch (BindException ex) { + log.fatal("Failed to launch server, " + ex.getMessage(), ex); + trayIcon.displayMessage(messages.getString(CAPTION_ERROR), + messages.getString(ERROR_BIND), TrayIcon.MessageType.ERROR); + throw ex; + } catch (MultiException ex) { + log.fatal("Failed to launch server, " + ex.getMessage(), ex); + if (ex.getThrowable(0) instanceof BindException) { + trayIcon.displayMessage(messages.getString(CAPTION_ERROR), + messages.getString(ERROR_BIND), TrayIcon.MessageType.ERROR); + } else { + trayIcon.displayMessage(messages.getString(CAPTION_ERROR), + messages.getString(ERROR_START), TrayIcon.MessageType.ERROR); + } + throw ex; + } catch (Exception ex) { + log.fatal("Failed to launch server, " + ex.getMessage(), ex); + trayIcon.displayMessage(messages.getString(CAPTION_ERROR), + messages.getString(ERROR_START), TrayIcon.MessageType.ERROR); + throw ex; + } + } + + private TrayIcon initTrayIcon() { //ResourceBundle messages, BKUControllerInterface bkuHook) { + if (SystemTray.isSupported()) { + try { + // get the SystemTray instance + SystemTray tray = SystemTray.getSystemTray(); + log.debug("TrayIcon size: " + tray.getTrayIconSize()); + String iconResource = (tray.getTrayIconSize().height < 25) + ? TRAYICON_RESOURCE + "24.png" + : 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 shutdownItem = new MenuItem(messages.getString(LABEL_SHUTDOWN)); + shutdownItem.addActionListener(listener); + shutdownItem.setActionCommand(TrayMenuListener.SHUTDOWN_COMMAND); + popup.add(shutdownItem); + + MenuItem aboutItem = new MenuItem(messages.getString(LABEL_ABOUT)); + aboutItem.setActionCommand(TrayMenuListener.ABOUT_COMMAND); + aboutItem.addActionListener(listener); + popup.add(aboutItem); + + TrayIcon ti = new TrayIcon(image, messages.getString(TOOLTIP_DEFAULT), popup); + ti.addActionListener(listener); + tray.add(ti); + return ti; + } catch (AWTException ex) { + log.error("Failed to init tray icon", ex); + } catch (IOException ex) { + log.error("Failed to load tray icon image", ex); + } + } else { + log.error("No system tray support"); + } + return null; + } private void initStart() { try { + trayIcon.displayMessage(messages.getString(CAPTION_DEFAULT), + messages.getString(MESSAGE_START), TrayIcon.MessageType.INFO); basicService = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService"); if (basicService.isOffline()) { log.info("launching MOCCA Web Start offline"); + trayIcon.displayMessage(messages.getString(CAPTION_DEFAULT), + messages.getString(MESSAGE_START_OFFLINE), TrayIcon.MessageType.INFO); } else { log.info("launching MOCCA Web Start online"); } @@ -96,30 +200,20 @@ public class Launcher implements BKUControllerInterface { } } - private void initTrayIcon() { - log.debug("init MOCCA tray icon"); - Locale loc = Locale.getDefault(); - ResourceBundle resourceBundle; - try { - resourceBundle = ResourceBundle.getBundle( - MESSAGES_RESOURCE, loc); - } catch (MissingResourceException mx) { - resourceBundle = ResourceBundle.getBundle( - MESSAGES_RESOURCE, Locale.ENGLISH); - } - TrayIconDialog.getInstance().init(resourceBundle); - TrayIconDialog.getInstance().setShutdownHook(this); -// TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); - } - private void initConfig() throws IOException, CodingException, GeneralSecurityException { + trayIcon.displayMessage(messages.getString(CAPTION_DEFAULT), + messages.getString(MESSAGE_CONFIG), TrayIcon.MessageType.INFO); config = new Configurator(); config.ensureConfiguration(); + trayIcon.displayMessage(messages.getString(CAPTION_DEFAULT), + messages.getString(MESSAGE_CERTS), TrayIcon.MessageType.INFO); config.ensureCertificates(); } private void startServer() throws Exception { log.info("init servlet container and MOCCA webapp"); +// trayIcon.displayMessage(messages.getString(CAPTION_DEFAULT), +// messages.getString(MESSAGE_START), TrayIcon.MessageType.INFO); server = new Container(); server.init(); server.start(); @@ -127,6 +221,8 @@ public class Launcher implements BKUControllerInterface { private void initFinished() { try { + trayIcon.displayMessage(messages.getString(CAPTION_DEFAULT), + messages.getString(MESSAGE_FINISHED), TrayIcon.MessageType.INFO); // standalone (non-webstart) version has splashscreen if (SplashScreen.getSplashScreen() != null) { try { @@ -162,6 +258,8 @@ public class Launcher implements BKUControllerInterface { @Override public void shutDown() { log.info("Shutting down server"); + trayIcon.displayMessage(messages.getString(CAPTION_DEFAULT), + messages.getString(MESSAGE_SHUTDOWN), TrayIcon.MessageType.INFO); if ((server != null) && (server.isRunning())) { try { if (server.isRunning()) { @@ -179,51 +277,13 @@ public class Launcher implements BKUControllerInterface { } public static void main(String[] args) throws InterruptedException, IOException { - - if (log.isTraceEnabled()) { - SecurityManager sm = System.getSecurityManager(); - if (sm instanceof JavaWebStartSecurity) { - System.setSecurityManager(new LogSecurityManager((JavaWebStartSecurity) sm)); - } - } - - Launcher launcher = new Launcher(); - launcher.initStart(); - launcher.initTrayIcon(); //keep reference? BKULauncher not garbage collected after main() - try { - TrayIconDialog.getInstance().displayInfo(CONFIG_CAPTION, CONFIG_MESSAGE); - launcher.initConfig(); + Launcher launcher = new Launcher(); + launcher.launch(); } catch (Exception ex) { - log.fatal("Failed to initialize configuration", ex); - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_CONF_MESSAGE); - Thread.sleep(5000); - System.exit(-1000); - } - - try { - TrayIconDialog.getInstance().displayInfo(STARTUP_CAPTION, STARTUP_MESSAGE); - launcher.startServer(); - TrayIconDialog.getInstance().displayInfo(GREETING_CAPTION, GREETING_MESSAGE); - launcher.initFinished(); - } catch (BindException ex) { - log.fatal("Failed to launch server, " + ex.getMessage(), ex); - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); - Thread.sleep(5000); - System.exit(-1000); - } catch (MultiException ex) { - log.fatal("Failed to launch server, " + ex.getMessage(), ex); - if (ex.getThrowable(0) instanceof BindException) { - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_BIND_MESSAGE); - } else { - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); - } - Thread.sleep(5000); - System.exit(-1000); - } catch (Exception e) { - log.fatal("Failed to launch server, " + e.getMessage(), e); - TrayIconDialog.getInstance().displayError(ERROR_CAPTION, ERROR_STARTUP_MESSAGE); + log.info("waiting to shutdown..."); Thread.sleep(5000); + log.info("exit"); System.exit(-1000); } } diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form new file mode 100644 index 00000000..c1cfdab7 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form @@ -0,0 +1,139 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java new file mode 100644 index 00000000..efa80bd6 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java @@ -0,0 +1,162 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +/* + * AboutDialog.java + * + * Created on 18.08.2009, 11:54:44 + */ + +package at.gv.egiz.bku.webstart.gui; + +import java.text.Format; +import java.text.MessageFormat; +import java.util.ResourceBundle; + +/** + * + * @author clemens + */ +public class AboutDialog extends javax.swing.JDialog { + + /** Creates new form AboutDialog */ + public AboutDialog(java.awt.Frame parent, boolean modal, String version) { + super(parent, modal); + this.version = version; + initComponents(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + jButton1 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("at/gv/egiz/bku/webstart/messages"); // NOI18N + setTitle(bundle.getString("about.frame.title")); // NOI18N + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/at/gv/egiz/bku/webstart/logo_notext.png"))); // NOI18N + + jLabel2.setText(getVersionText(bundle)); + + jLabel3.setText(bundle.getString("about.title")); // NOI18N + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jLabel2)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel2)) + ); + + jButton1.setText(bundle.getString("button.close")); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addContainerGap(157, Short.MAX_VALUE) + .addComponent(jButton1) + .addContainerGap()) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton1) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private String getVersionText(ResourceBundle bundle) { + return MessageFormat.format(bundle.getString("about.version"), version); + } + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + // TODO add your handling code here: + setVisible(false); + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + AboutDialog dialog = new AboutDialog(new javax.swing.JFrame(), true, "1.2.3"); + dialog.addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent e) { + System.exit(0); + } + }); + dialog.setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel3; + // End of variables declaration//GEN-END:variables + + private String version; +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/BKUControllerInterface.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/BKUControllerInterface.java new file mode 100644 index 00000000..886b55f7 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/BKUControllerInterface.java @@ -0,0 +1,23 @@ +/* +* 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; + +public interface BKUControllerInterface { + + public void shutDown(); + +} 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 new file mode 100644 index 00000000..1e5efe8e --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/TrayMenuListener.java @@ -0,0 +1,75 @@ +/* + * 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 + */ +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/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java deleted file mode 100644 index fd9838f9..00000000 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/BKUControllerInterface.java +++ /dev/null @@ -1,23 +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.ui; - -public interface BKUControllerInterface { - - public void shutDown(); - -} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java deleted file mode 100644 index fb7c40dd..00000000 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialog.java +++ /dev/null @@ -1,205 +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.ui; - -import java.awt.AWTException; -import java.awt.Image; -import java.awt.MenuItem; -import java.awt.PopupMenu; -import java.awt.SystemTray; -import java.awt.TrayIcon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.IOException; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.ResourceBundle; - -import javax.imageio.ImageIO; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -public class TrayIconDialog implements TrayIconDialogInterface { - public static final String TRAYICON_RESOURCE = "at/gv/egiz/bku/webstart/ui/trayicon_32.png"; - public static final String TRAYMENU_SHUTDOWN = "TrayMenu.Shutdown"; - public static final String TRAYMENU_TOOLTIP = "TrayMenu.Tooltip"; - - private static Log log = LogFactory.getLog(TrayIconDialog.class); - private static TrayIconDialogInterface instance; - private boolean isSupported; - private BKUControllerInterface shutDown; - private TrayIcon trayIcon = null; - private ResourceBundle resourceBundle = null; - - private TrayIconDialog() { - } - - private void displayTrayMsg(String captionID, String messageID, - TrayIcon.MessageType type) { - if ((isSupported) && (resourceBundle != null)) { - try { - trayIcon.displayMessage(resourceBundle.getString(captionID), - resourceBundle.getString(messageID), type); - } catch (Exception ex) { - log.error(ex); - } - } - } - - /* - * (non-Javadoc) - * - * @see - * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#displayInfo(java.lang.String - * , java.lang.String) - */ - public void displayInfo(String captionID, String messageID) { - displayTrayMsg(captionID, messageID, TrayIcon.MessageType.INFO); - } - - /* - * (non-Javadoc) - * - * @see - * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#displayWarning(java.lang - * .String, java.lang.String) - */ - public void displayWarning(String captionID, String messageID) { - displayTrayMsg(captionID, messageID, TrayIcon.MessageType.WARNING); - } - - /* - * (non-Javadoc) - * - * @see - * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#displayError(java.lang. - * String, java.lang.String) - */ - public void displayError(String captionID, String messageID) { - displayTrayMsg(captionID, messageID, TrayIcon.MessageType.ERROR); - } - - /* - * (non-Javadoc) - * - * @see - * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#init(java.util.ResourceBundle - * ) - */ - public void init(ResourceBundle resourceBundel) { - this.resourceBundle = resourceBundel; - isSupported = SystemTray.isSupported(); - log.info("Trayicon supported: " + isSupported); - try { - if (isSupported) { - SystemTray tray = SystemTray.getSystemTray(); - Image image = ImageIO.read(getClass().getClassLoader() - .getResourceAsStream(TRAYICON_RESOURCE)); - PopupMenu popup = new PopupMenu(); - MenuItem exitItem = new MenuItem(resourceBundel - .getString(TRAYMENU_SHUTDOWN)); - popup.add(exitItem); - exitItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - log.info("Calling Shutdown"); - if (shutDown != null) { - shutDown.shutDown(); - } - } - }); - - trayIcon = new TrayIcon(image, "BKULogo", popup); - trayIcon.setImageAutoSize(true); - trayIcon.setToolTip(resourceBundel.getString(TRAYMENU_TOOLTIP)); - try { - tray.add(trayIcon); - } catch (AWTException e) { - log.error("TrayIcon could not be added.", e); - isSupported = false; - } - } - } catch (IOException e) { - log.error(e); - } - } - - /* - * (non-Javadoc) - * - * @see - * at.gv.egiz.bku.local.ui.TrayIconDialogInterface#setShutdownHook(at.gv.egiz - * .bku.local.ui.BKUControllerInterface) - */ - public void setShutdownHook(BKUControllerInterface shutDown) { - this.shutDown = shutDown; - } - - @SuppressWarnings("unchecked") - public synchronized static TrayIconDialogInterface getInstance() { - ClassLoader cl = TrayIconDialog.class.getClassLoader(); - if (instance == null) { - if (cl.toString().equals(cl.getParent().toString())) { - instance = new TrayIconDialog(); - return instance; - } - ClassLoader parent = cl; - while (!parent.toString().equals(cl.getParent().toString())) { - parent = parent.getParent(); - } - try { - Class otherClassInstance = (Class) parent - .loadClass(TrayIconDialog.class.getName()); - Method getInstanceMethod = otherClassInstance.getDeclaredMethod( - "getInstance", new Class[] {}); - Object otherSingleton = getInstanceMethod.invoke(null, new Object[] {}); - instance = (TrayIconDialogInterface) Proxy.newProxyInstance(cl, - new Class[] { TrayIconDialogInterface.class }, - new PassThroughProxyHandler(otherSingleton)); - } catch (ClassNotFoundException ce) { - instance = new TrayIconDialog(); - } catch (Exception e) { - log.error(e); - instance = new TrayIconDialog(); - } - return instance; - } - return instance; - } - - /** - * - * Only works for public methods - * - */ - static class PassThroughProxyHandler implements InvocationHandler { - private final Object delegate; - - public PassThroughProxyHandler(Object delegate) { - this.delegate = delegate; - } - - public Object invoke(Object proxy, Method method, Object[] args) - throws Throwable { - Method delegateMethod = delegate.getClass().getMethod(method.getName(), - method.getParameterTypes()); - return delegateMethod.invoke(delegate, args); - } - } - -} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java deleted file mode 100644 index 078844cb..00000000 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/ui/TrayIconDialogInterface.java +++ /dev/null @@ -1,33 +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.ui; - -import java.util.ResourceBundle; - -public interface TrayIconDialogInterface { - - public abstract void displayInfo(String captionID, String messageID); - - public abstract void displayWarning(String captionID, String messageID); - - public abstract void displayError(String captionID, String messageID); - - public abstract void init(ResourceBundle resourceBundel); - - public abstract void setShutdownHook(BKUControllerInterface shutDown); - -} \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_24.png b/BKUWebStart/src/main/jnlp/resources/img/logo_24.png new file mode 100644 index 00000000..a9074f01 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/logo_24.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/splash.png b/BKUWebStart/src/main/jnlp/resources/img/splash.png index 72c1d868..597fbc60 100644 Binary files a/BKUWebStart/src/main/jnlp/resources/img/splash.png and b/BKUWebStart/src/main/jnlp/resources/img/splash.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/version.xml b/BKUWebStart/src/main/jnlp/resources/img/version.xml index 31f43441..1ba3ecda 100644 --- a/BKUWebStart/src/main/jnlp/resources/img/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/img/version.xml @@ -2,43 +2,29 @@ - logo_16.xpm - 1.0-SNAPSHOT + logo_24 + 1.0 - logo_16.xpm + logo_24.png - logo_16.ico - 1.0-SNAPSHOT - - logo_16.ico - - - - logo_16.png - 1.0-SNAPSHOT - - logo_16.png - - - - logo_32.png - 1.0-SNAPSHOT + logo_32 + 1.0 logo_32.png - logo_64.png - 1.0-SNAPSHOT + logo_64 + 1.0 logo_64.png - splash.png - 1.0-SNAPSHOT + splash + 2.0 splash.png diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml index 9135ba1b..80447c89 100644 --- a/BKUWebStart/src/main/jnlp/template-local.xml +++ b/BKUWebStart/src/main/jnlp/template-local.xml @@ -10,7 +10,9 @@ $project.Description (BKU) MOCCA Web Start $project.Description + + diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 0176376a..bbc4c466 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -10,10 +10,10 @@ $project.Description (BKU) MOCCA Web Start $project.Description - - - - + + + + diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png new file mode 100644 index 00000000..a9074f01 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png new file mode 100644 index 00000000..3c77d179 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png new file mode 100644 index 00000000..407f3b3e Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png differ 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 new file mode 100644 index 00000000..d965f970 --- /dev/null +++ b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages.properties @@ -0,0 +1,35 @@ +# 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. + +tray.caption.default=B\u00FCrgerkarte +tray.caption.error=Fehler +tray.message.start=B\u00FCrgerkartenumgebung wird gestartet... +tray.message.start.offline=B\u00FCrgerkartenumgebung wird offline gestartet... +tray.message.config=Konfiguration wird geladen +tray.message.certs=Zertifikate werden geladen +tray.message.finished=B\u00FCrgerkartenumgebung erfolgreich gestartet +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.label.shutdown=Beenden +tray.label.pin=PIN Verwaltung +tray.label.about=\u00DCber... +tray.tooltip.default=B\u00FCrgerkartenumgebung +about.frame.title=B\u00FCrgerkarte +about.title=B\u00FCrgerkartenumgebung +about.version=Version: {0} +button.ok=Best\u00E4tigen +button.close=Schlie\u00DFen diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/splash.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/splash.png new file mode 100644 index 00000000..597fbc60 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/splash.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties deleted file mode 100644 index bf4e5b8a..00000000 --- a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/UIMessages.properties +++ /dev/null @@ -1,20 +0,0 @@ -#-------- tray icon messages ------- -TrayMenu.Tooltip=B\u00FCrgerkartenumgebung -TrayMenu.Shutdown=B\u00FCrgerkartenumgebung beenden - -Config.Message=Zertifikate werden geladen -Config.Caption=B\u00FCrgerkartenumgebung -Startup.Message=B\u00FCrgerkartenumgebung wird gestartet... -Startup.Caption=B\u00FCrgerkartenumgebung -Greetings.Message=B\u00FCrgerkartenumgebung erfolgreich gestartet -Greetings.Caption=B\u00FCrgerkartenumgebung -Error.Caption=Fehler -Error.Startup.Message=B\u00FCrgerkartenumgebung konnte nicht gestartet werden -Error.Conf.Message=Konfiguration konnte nicht initialisiert werden, B\u00FCrberkartenumgebung wird nicht gestartet -Error.Bind.Message=Die f\u00FCr die B\u00FCrgerkartenumgebung reservierte Adresse wird bereits von einem anderen Dienst verwendet -Message.RequestCaption=New Request -Message.InfoboxReadRequest=Reading Infobox -Message.SecureSignatureKeypair=Reading secure signature certificate -Message.CertifiedKeypair=Reading certified certificate -Message.IdentityLink=Reading Identitylink -Message.SignRequest=Creating Signature \ No newline at end of file diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png deleted file mode 100644 index 2d0276de..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/favicon.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png deleted file mode 100644 index f84f108d..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_16.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png deleted file mode 100644 index 2c622d88..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/ui/trayicon_32.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/logo_32x32.png b/BKUWebStart/src/main/resources/logo_32x32.png deleted file mode 100644 index 337b144b..00000000 Binary files a/BKUWebStart/src/main/resources/logo_32x32.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/logo_90x90.png b/BKUWebStart/src/main/resources/logo_90x90.png deleted file mode 100644 index d7f8bbd0..00000000 Binary files a/BKUWebStart/src/main/resources/logo_90x90.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/logo_RGB22x22.png b/BKUWebStart/src/main/resources/logo_RGB22x22.png deleted file mode 100644 index 598ab00b..00000000 Binary files a/BKUWebStart/src/main/resources/logo_RGB22x22.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/logo_RGB32x32.png b/BKUWebStart/src/main/resources/logo_RGB32x32.png deleted file mode 100644 index 2c622d88..00000000 Binary files a/BKUWebStart/src/main/resources/logo_RGB32x32.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/splash_standalone.png b/BKUWebStart/src/main/resources/splash_standalone.png deleted file mode 100644 index 72c1d868..00000000 Binary files a/BKUWebStart/src/main/resources/splash_standalone.png and /dev/null differ diff --git a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java index 0c08a276..0ea126cb 100644 --- a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java +++ b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java @@ -118,6 +118,30 @@ public class ConfiguratorTest { result = Configurator.updateRequired(oldVersion, minVersion); assertEquals(expResult, result); + oldVersion = "1.0.9-SNAPSHOT-r123"; + minVersion = "1.0.10-r432"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-r123"; + minVersion = "1.0.10-SNAPSHOT"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-r123"; + minVersion = "1.0.9-SNAPSHOT"; + expResult = false; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + + oldVersion = "1.0.9-SNAPSHOT"; + minVersion = "1.0.9-r349"; + expResult = true; + result = Configurator.updateRequired(oldVersion, minVersion); + assertEquals(expResult, result); + oldVersion = "1.0.9-SNAPSHOT-r123"; minVersion = "1.0.10-SNAPSHOT"; expResult = true; -- cgit v1.2.3 From 22001c93bca360d1b15c252cb22d2a4147ff350d Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 16:24:55 +0000 Subject: [#430] Activation/PIN-management in MOCCA Web Start - new Modules: smccSTALExt, BKUGuiExt in order not to depend on BKUAppletExt in BKULocal - provide stal-request handler de-registration in abstractSMCCSTAL git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@448 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/webstart/Launcher.java | 104 ++++++++++++++++----- .../bku/webstart/gui/PINManagementInvoker.java | 71 ++++++++++++++ .../gv/egiz/bku/webstart/gui/TrayMenuListener.java | 75 --------------- BKUWebStart/src/main/jnlp/resources/version.xml | 12 +-- .../at/gv/egiz/bku/webstart/messages.properties | 1 + 5 files changed, 160 insertions(+), 103 deletions(-) create mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/PINManagementInvoker.java delete mode 100644 BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/TrayMenuListener.java (limited to 'BKUWebStart') 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 + */ +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 - */ -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 @@ - BKUWebStart-1.0.10.jar - 1.0.10 + BKUWebStart-1.0.11-SNAPSHOT.jar + 1.0.11-SNAPSHOT - BKUWebStart-1.0.10.jar + BKUWebStart-1.0.11-SNAPSHOT.jar - utils-1.2.1.jar - 1.2.1 + utils-1.2.2-SNAPSHOT.jar + 1.2.2-SNAPSHOT - utils-1.2.1.jar + utils-1.2.2-SNAPSHOT.jar 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... -- cgit v1.2.3 From 65f25f58df0df1d8a90625f3944155235a9d20be Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 16:33:43 +0000 Subject: 24x24 icon for webstart 16x16 tray icon git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@449 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/webstart/Launcher.java | 12 +++++++++--- BKUWebStart/src/main/jnlp/template.xml | 2 ++ .../main/resources/at/gv/egiz/bku/webstart/logo_16.png | Bin 0 -> 1084 bytes 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png (limited to 'BKUWebStart') 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 ca40ddc0..d216fdc4 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 @@ -171,9 +171,15 @@ public class Launcher implements BKUControllerInterface, ActionListener { // get the SystemTray instance SystemTray tray = SystemTray.getSystemTray(); log.debug("TrayIcon size: " + tray.getTrayIconSize()); - String iconResource = (tray.getTrayIconSize().height < 25) - ? TRAYICON_RESOURCE + "24.png" - : TRAYICON_RESOURCE + "32.png"; + + String iconResource; + if (tray.getTrayIconSize().height < 17) { + iconResource = TRAYICON_RESOURCE + "16.png"; + } else if (tray.getTrayIconSize().height < 25) { + iconResource = TRAYICON_RESOURCE + "24.png"; + } else { + iconResource = TRAYICON_RESOURCE + "32.png"; + } Image image = ImageIO.read(Launcher.class.getClassLoader().getResourceAsStream(iconResource)); PopupMenu popup = new PopupMenu(); diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index bbc4c466..5d9db869 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -10,7 +10,9 @@ $project.Description (BKU) MOCCA Web Start $project.Description + + diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png new file mode 100644 index 00000000..f84f108d Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png differ -- cgit v1.2.3 From b05ed4a6269f13602077047689c1a2e69f99bd4e Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 16:44:17 +0000 Subject: pkcs11-pass property git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@450 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 03f5f5f3..c8278d59 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -183,7 +183,7 @@ PKCS11 iaik.pkcs.pkcs11.provider.IAIKPkcs11 a-sit - + ${pkcs11-pass} true false -- cgit v1.2.3 From ddb7f48bec002481ee4ae2696ecfe89edaec226b Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:00:13 +0000 Subject: include-webstart version set to bkuOnline version BKUWebStart version.xml updated for release 1.2.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@451 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/src/main/jnlp/resources/version.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 64a3963e..c1546b44 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,17 +2,17 @@ - BKUWebStart-1.0.11-SNAPSHOT.jar - 1.0.11-SNAPSHOT + BKUWebStart-1.2.2.jar + 1.2.2 - BKUWebStart-1.0.11-SNAPSHOT.jar + BKUWebStart-1.2.2 - utils-1.2.2-SNAPSHOT.jar - 1.2.2-SNAPSHOT + utils-1.2.2.jar + 1.2.2 - utils-1.2.2-SNAPSHOT.jar + utils-1.2.2.jar -- cgit v1.2.3 From ac6d2a37ee43ddc48cc0a1e40371366607624db7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:08:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@453 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index c8278d59..0fd975e8 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,7 +2,7 @@ bku at.gv.egiz - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT 4.0.0 at.gv.egiz @@ -13,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.0.11-SNAPSHOT + 1.2.3-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung -- cgit v1.2.3 From ada7c53ce1c19ba26b988e43da51a1a99d584b14 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:10:52 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.2.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@454 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 0fd975e8..c8278d59 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,7 +2,7 @@ bku at.gv.egiz - 1.2.3-SNAPSHOT + 1.2.2-SNAPSHOT 4.0.0 at.gv.egiz @@ -13,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.2.3-SNAPSHOT + 1.0.11-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung -- cgit v1.2.3 From e676ab1e361aff7ff7417f8f6e93ad176ef6cb60 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:27:08 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@455 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index c8278d59..8c024bbc 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,7 +2,7 @@ bku at.gv.egiz - 1.2.2-SNAPSHOT + 1.2.2 4.0.0 at.gv.egiz @@ -13,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.0.11-SNAPSHOT + 1.2.2 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -224,7 +224,7 @@ at.gv.egiz BKULocal - 1.0.11-SNAPSHOT + 1.2.2 war @@ -235,7 +235,7 @@ utils at.gv.egiz - 1.2.2-SNAPSHOT + 1.2.2 iaik_ecc_signed -- cgit v1.2.3 From 1102477bc94590a21eaf3bcbd50baa0b6ed13529 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:32:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@458 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 8c024bbc..62a06f42 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,7 +2,7 @@ bku at.gv.egiz - 1.2.2 + 1.2.3-SNAPSHOT 4.0.0 at.gv.egiz @@ -13,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.2.2 + 1.2.3-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -224,7 +224,7 @@ at.gv.egiz BKULocal - 1.2.2 + 1.2.3-SNAPSHOT war @@ -235,7 +235,7 @@ utils at.gv.egiz - 1.2.2 + 1.2.3-SNAPSHOT iaik_ecc_signed -- cgit v1.2.3 From 84eee5daccfebb3fad94eae986c46748c4cfc3f6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:03:40 +0000 Subject: icons 2.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@465 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/webstart/Launcher.java | 10 +- .../at/gv/egiz/bku/webstart/gui/AboutDialog.form | 6 +- .../at/gv/egiz/bku/webstart/gui/AboutDialog.java | 6 +- .../src/main/jnlp/resources/img/chip128.png | Bin 0 -> 7775 bytes BKUWebStart/src/main/jnlp/resources/img/chip16.png | Bin 0 -> 787 bytes BKUWebStart/src/main/jnlp/resources/img/chip24.png | Bin 0 -> 1227 bytes BKUWebStart/src/main/jnlp/resources/img/chip32.png | Bin 0 -> 1753 bytes BKUWebStart/src/main/jnlp/resources/img/chip48.png | Bin 0 -> 2771 bytes .../src/main/jnlp/resources/img/logo_16.ico | Bin 1406 -> 0 bytes .../src/main/jnlp/resources/img/logo_16.png | Bin 1084 -> 0 bytes .../src/main/jnlp/resources/img/logo_16.xpm | 274 --------------------- .../src/main/jnlp/resources/img/logo_24.png | Bin 1982 -> 0 bytes .../src/main/jnlp/resources/img/logo_32.png | Bin 1522 -> 0 bytes .../src/main/jnlp/resources/img/logo_64.gif | Bin 1690 -> 0 bytes .../src/main/jnlp/resources/img/logo_64.jpeg | Bin 1347 -> 0 bytes .../src/main/jnlp/resources/img/logo_64.png | Bin 1689 -> 0 bytes .../src/main/jnlp/resources/img/version.xml | 41 ++- BKUWebStart/src/main/jnlp/resources/version.xml | 12 +- BKUWebStart/src/main/jnlp/template-local.xml | 14 +- BKUWebStart/src/main/jnlp/template.xml | 14 +- .../resources/at/gv/egiz/bku/webstart/chip16.png | Bin 0 -> 787 bytes .../resources/at/gv/egiz/bku/webstart/chip24.png | Bin 0 -> 1227 bytes .../resources/at/gv/egiz/bku/webstart/chip32.png | Bin 0 -> 1753 bytes .../resources/at/gv/egiz/bku/webstart/chip48.png | Bin 0 -> 2771 bytes .../at/gv/egiz/bku/webstart/chiperling96.png | Bin 0 -> 7378 bytes .../resources/at/gv/egiz/bku/webstart/logo_16.png | Bin 1084 -> 0 bytes .../resources/at/gv/egiz/bku/webstart/logo_24.png | Bin 1982 -> 0 bytes .../resources/at/gv/egiz/bku/webstart/logo_32.png | Bin 3228 -> 0 bytes .../at/gv/egiz/bku/webstart/logo_notext.png | Bin 3291 -> 0 bytes 29 files changed, 66 insertions(+), 311 deletions(-) create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip128.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip16.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip24.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip32.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip48.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_16.ico delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_16.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_24.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_32.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64.gif delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/logo_64.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip16.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip24.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip32.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip48.png create mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chiperling96.png delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png delete mode 100644 BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png (limited to 'BKUWebStart') 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 d216fdc4..0cfc14e5 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 @@ -42,8 +42,9 @@ public class Launcher implements BKUControllerInterface, ActionListener { public static final String WEBAPP_RESOURCE = "BKULocal.war"; public static final String CERTIFICATES_RESOURCE = "BKUCertificates.jar"; public static final String WEBAPP_FILE = "BKULocal.war"; + /** no leading slash for messages, but for image */ public static final String MESSAGES_RESOURCE = "at/gv/egiz/bku/webstart/messages"; - public static final String TRAYICON_RESOURCE = "at/gv/egiz/bku/webstart/logo_"; + public static final String TRAYICON_RESOURCE = "/at/gv/egiz/bku/webstart/chip"; /** resource bundle messages */ public static final String CAPTION_DEFAULT = "tray.caption.default"; public static final String CAPTION_ERROR = "tray.caption.error"; @@ -177,10 +178,12 @@ public class Launcher implements BKUControllerInterface, ActionListener { iconResource = TRAYICON_RESOURCE + "16.png"; } else if (tray.getTrayIconSize().height < 25) { iconResource = TRAYICON_RESOURCE + "24.png"; - } else { + } else if (tray.getTrayIconSize().height < 33) { iconResource = TRAYICON_RESOURCE + "32.png"; + } else { + iconResource = TRAYICON_RESOURCE + "48.png"; } - Image image = ImageIO.read(Launcher.class.getClassLoader().getResourceAsStream(iconResource)); + Image image = ImageIO.read(getClass().getResourceAsStream(iconResource)); PopupMenu popup = new PopupMenu(); @@ -347,6 +350,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { Launcher launcher = new Launcher(); launcher.launch(); } catch (Exception ex) { + log.debug(ex); log.info("waiting to shutdown..."); Thread.sleep(5000); log.info("exit"); diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form index c1cfdab7..548893a7 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.form @@ -40,7 +40,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -106,7 +106,7 @@ - + diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java index efa80bd6..1e35af58 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java @@ -48,7 +48,7 @@ public class AboutDialog extends javax.swing.JDialog { java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("at/gv/egiz/bku/webstart/messages"); // NOI18N setTitle(bundle.getString("about.frame.title")); // NOI18N - jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/at/gv/egiz/bku/webstart/logo_notext.png"))); // NOI18N + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/at/gv/egiz/bku/webstart/chiperling96.png"))); // NOI18N jLabel2.setText(getVersionText(bundle)); @@ -88,7 +88,7 @@ public class AboutDialog extends javax.swing.JDialog { jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addContainerGap(157, Short.MAX_VALUE) + .addContainerGap(163, Short.MAX_VALUE) .addComponent(jButton1) .addContainerGap()) ); @@ -116,7 +116,7 @@ public class AboutDialog extends javax.swing.JDialog { .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip128.png b/BKUWebStart/src/main/jnlp/resources/img/chip128.png new file mode 100644 index 00000000..c36d8079 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/chip128.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip16.png b/BKUWebStart/src/main/jnlp/resources/img/chip16.png new file mode 100644 index 00000000..96b580e9 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/chip16.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip24.png b/BKUWebStart/src/main/jnlp/resources/img/chip24.png new file mode 100644 index 00000000..efd6dbeb Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/chip24.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip32.png b/BKUWebStart/src/main/jnlp/resources/img/chip32.png new file mode 100644 index 00000000..e7efb020 Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/chip32.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip48.png b/BKUWebStart/src/main/jnlp/resources/img/chip48.png new file mode 100644 index 00000000..491fbcac Binary files /dev/null and b/BKUWebStart/src/main/jnlp/resources/img/chip48.png differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_16.ico b/BKUWebStart/src/main/jnlp/resources/img/logo_16.ico deleted file mode 100644 index eaedb0ad..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_16.ico and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_16.png b/BKUWebStart/src/main/jnlp/resources/img/logo_16.png deleted file mode 100644 index f84f108d..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_16.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm b/BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm deleted file mode 100644 index de557170..00000000 --- a/BKUWebStart/src/main/jnlp/resources/img/logo_16.xpm +++ /dev/null @@ -1,274 +0,0 @@ -/* XPM */ -static char * logo_16x16_xpm[] = { -"16 16 255 2", -" c #EDF2FA", -". c #555249", -"+ c #F3F6FC", -"@ c #ED1C24", -"# c #939698", -"$ c #FFE699", -"% c #BBAA76", -"& c #464749", -"* c #CCCCCC", -"= c #EE262D", -"- c #FCDADC", -"; c #6B6E72", -"> c #FDE4E5", -", c #D0D6DE", -"' c #968C78", -") c #848182", -"! c #535458", -"~ c #76797E", -"{ c #EE2C33", -"] c #444444", -"^ c #80848A", -"/ c #5A636E", -"( c #738974", -"_ c #ACAEB1", -": c #929F98", -"< c #47443F", -"[ c #363436", -"} c #E4ECF7", -"| c #5D5E61", -"1 c #F14C53", -"2 c #A2A3A5", -"3 c #EF333A", -"4 c #515052", -"5 c #5C685E", -"6 c #FDEAEB", -"7 c #7A7B7D", -"8 c #9FA1A4", -"9 c #FBFCFE", -"0 c #4B514D", -"a c #888A8C", -"b c #777777", -"c c #525355", -"d c #E7EEF8", -"e c #A4A9AF", -"f c #F04148", -"g c #FFF4D7", -"h c #616365", -"i c #231F20", -"j c #D4DDE9", -"k c #918F8F", -"l c #8A8E95", -"m c #F1CA3F", -"n c #B5BBC5", -"o c #F1F1F1", -"p c #9FA5AD", -"q c #363432", -"r c #888888", -"s c #FFFFFF", -"t c #7D745A", -"u c #94875D", -"v c #999999", -"w c #5F6165", -"x c #635E51", -"y c #C8C7C7", -"z c #CAD1DD", -"A c #5A5758", -"B c #C0C7D1", -"C c #9399A1", -"D c #E4C14B", -"E c #AE9B5E", -"F c #BAB9B9", -"G c #C9AE59", -"H c #767374", -"I c #D6D5D5", -"J c #DDDDDD", -"K c #666666", -"L c #E3E3E3", -"M c #ACABAB", -"N c #222222", -"O c #9E9D9D", -"P c #333333", -"Q c #EEEEEE", -"R c #BBA55C", -"S c #BBBBBB", -"T c #706A56", -"U c #3F3B3C", -"V c #A1915E", -"W c #686566", -"X c #AAB0B9", -"Y c #111111", -"Z c #444344", -"` c #897E5C", -" . c #4C494A", -".. c #669DCD", -"+. c #C6C8CA", -"@. c #555556", -"#. c #312D2E", -"$. c #5F6A78", -"%. c #6C95BC", -"&. c #D6B853", -"*. c #525962", -"=. c #636467", -"-. c #6C8AAA", -";. c #E1E2E3", -">. c #DE9E56", -",. c #70B76A", -"'. c #6C90B3", -"). c #AB875E", -"!. c #F2575D", -"~. c #B9BBBD", -"{. c #FFF1CC", -"]. c #424347", -"^. c #4A4E55", -"/. c #637183", -"(. c #ED2028", -"_. c #65778C", -":. c #688268", -"<. c #7C7F81", -"[. c #706355", -"}. c #B88E5F", -"|. c #C5945D", -"1. c #565E58", -"2. c #D9ECD4", -"3. c #72A26F", -"4. c #72AA6E", -"5. c #FBB161", -"6. c #AAAAAA", -"7. c #937A5D", -"8. c #6B84A0", -"9. c #FFEDB5", -"0. c #F1CE5D", -"a. c #FFDBB4", -"b. c #697E96", -"c. c #EAA151", -"d. c #92CD8B", -"e. c #77C371", -"f. c #7C6C59", -"g. c #719B6E", -"h. c #FCBB75", -"i. c #FFD742", -"j. c #606162", -"k. c #6C6C6E", -"l. c #E2E3E4", -"m. c #6999C5", -"n. c #D4D5D7", -"o. c #F7F9FD", -"p. c #635950", -"q. c #F0F0F1", -"r. c #FDE3E4", -"s. c #706F6D", -"t. c #FFDD6F", -"u. c #787E88", -"v. c #D6BC69", -"w. c #EEEFF0", -"x. c #63615A", -"y. c #89C982", -"z. c #AEA58E", -"A. c #F3F9F1", -"B. c #4D5056", -"C. c #6E926C", -"D. c #6C8A6A", -"E. c #E4C564", -"F. c #77A0C8", -"G. c #898169", -"H. c #FFF7EE", -"I. c #333336", -"J. c #727878", -"K. c #AE9D66", -"L. c #607160", -"M. c #6B756F", -"N. c #71B16C", -"O. c #948A6C", -"P. c #7DC479", -"Q. c #D6BA5E", -"R. c #E1F0DE", -"S. c #ADD8A4", -"T. c #6E737C", -"U. c #9E8262", -"V. c #535D54", -"W. c #7D7766", -"X. c #A1A6AD", -"Y. c #D3D4D7", -"Z. c #ADAAA6", -"`. c #B7B9BC", -" + c #C39765", -".+ c #F25E64", -"++ c #F36268", -"@+ c #769C74", -"#+ c #B69166", -"$+ c #F9FBFD", -"%+ c #FFFBFB", -"&+ c #FFE07C", -"*+ c #646B68", -"=+ c #6D6965", -"-+ c #738498", -";+ c #C8BEA3", -">+ c #C1C4C9", -",+ c #A19984", -"'+ c #E4C979", -")+ c #F1D375", -"!+ c #80C679", -"~+ c #B3B6BC", -"{+ c #8D9096", -"]+ c #9FA8A1", -"^+ c #CFD9CE", -"/+ c #FED5A9", -"(+ c #D5D9E0", -"_+ c #8D877F", -":+ c #697B6A", -"<+ c #FFFBF0", -"[+ c #E3D4AC", -"}+ c #F1CC4F", -"|+ c #FFD954", -"1+ c #C8E4C0", -"2+ c #BEE0B7", -"3+ c #D6BE73", -"4+ c #857869", -"5+ c #E5E1DC", -"6+ c #85A7CB", -"7+ c #C9B26C", -"8+ c #D4C6B5", -"9+ c #C9B67E", -"0+ c #FFE5CA", -"a+ c #FCB66B", -"b+ c #E4E4E5", -"c+ c #E3E4E5", -"d+ c #E8EBEF", -"e+ c #EBEDF0", -"f+ c #87898C", -"g+ c #B19E7E", -"h+ c #B5C2BF", -"i+ c #FDC180", -"j+ c #EE2930", -"k+ c #E4E8EE", -"l+ c #565552", -"m+ c #E4CE8D", -"n+ c #636C79", -"o+ c #A3D49B", -"p+ c #858B94", -"q+ c #84868C", -"r+ c #F1D069", -"s+ c #D2995A", -"t+ c #B8BEC6", -"u+ c #EF3B42", -"v+ c #474444", -"w+ c #E1E5EC", -"x+ c #FDFEFE", -"y+ c #FFF7E3", -"z+ c #62A1D7", -"A+ c #6DC067", -"B+ c #FAA74A", -"C+ c #FFD531", -"D+ c #E0EAF7", -"E+ c #000000", -"F+ c #FFFFFF", -" 9 _ & < K.i.u i T R C+G x C+C+", -"+.& < E C+R . q q u C+C+T G C+C+", -"i t m m T q u m m x . m . C+C+C+", -"t D t q ` m C+C+C+C+t . < G E t ", -"x . E m C+C+C+C+C+C+C+. T u E m ", -"i m C+C+C+C+C+C+C+C+m T t C+C+C+", -"< V C+C+C+C+C+m D ` q x &.C+C+C+", -"G < C+C+C+E < . i x G C+C+C+C+C+", -"C+x V E < x E &.i G C+C+C+C+C+C+", -"}+` i ` D C+C+C+x x C+C+C+C+C+C+", -". R t E C+C+C+C+G i G C+C+C+C+C+", -"l+i.m x C+C+C+C+C+< x C+C+C+C+C+", -"i 7+C+u G C+C+E < q i G C+C+C+C+", -"i x.C+C+t E < x R C+< t C+C+C+C+", -"& i '+G x x D C+C+C+E i D C+C+C+", -"_ i [ V m u C+C+C+C+D i T m u < "}; diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_24.png b/BKUWebStart/src/main/jnlp/resources/img/logo_24.png deleted file mode 100644 index a9074f01..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_24.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_32.png b/BKUWebStart/src/main/jnlp/resources/img/logo_32.png deleted file mode 100644 index 337b144b..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_32.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64.gif b/BKUWebStart/src/main/jnlp/resources/img/logo_64.gif deleted file mode 100644 index 6081d1a1..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_64.gif and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg b/BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg deleted file mode 100644 index 720157a5..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_64.jpeg and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/logo_64.png b/BKUWebStart/src/main/jnlp/resources/img/logo_64.png deleted file mode 100644 index 9e9b377c..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/logo_64.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/version.xml b/BKUWebStart/src/main/jnlp/resources/img/version.xml index 1ba3ecda..826b58f6 100644 --- a/BKUWebStart/src/main/jnlp/resources/img/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/img/version.xml @@ -2,28 +2,49 @@ - logo_24 - 1.0 + logo16.png + 2.0 + + logo16.png + + + + logo24.png + 2.0 + + logo24.png + + + + logo32.png + 2.0 - logo_24.png + logo32.png - logo_32 - 1.0 + logo48.png + 2.0 - logo_32.png + logo48.png - logo_64 - 1.0 + logo64.png + 2.0 + + logo64.png + + + + logo128.png + 2.0 - logo_64.png + logo128.png - splash + splash.png 2.0 splash.png diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index c1546b44..e5f1d71c 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,17 +2,17 @@ - BKUWebStart-1.2.2.jar - 1.2.2 + BKUWebStart-1.2.3-SNAPSHOT.jar + 1.2.3-SNAPSHOT - BKUWebStart-1.2.2 + BKUWebStart-1.2.3-SNAPSHOT.jar - utils-1.2.2.jar - 1.2.2 + utils-1.2.3-SNAPSHOT.jar + 1.2.3-SNAPSHOT - utils-1.2.2.jar + utils-1.2.3-SNAPSHOT.jar diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml index 80447c89..ab987cae 100644 --- a/BKUWebStart/src/main/jnlp/template-local.xml +++ b/BKUWebStart/src/main/jnlp/template-local.xml @@ -9,12 +9,14 @@ $project.Description (BKU) MOCCA Web Start $project.Description - - - - - - + + + + + + + + diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 5d9db869..23d9379a 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -9,12 +9,14 @@ $project.Description (BKU) MOCCA Web Start $project.Description - - - - - - + + + + + + + + diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip16.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip16.png new file mode 100644 index 00000000..96b580e9 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip16.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip24.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip24.png new file mode 100644 index 00000000..efd6dbeb Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip24.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip32.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip32.png new file mode 100644 index 00000000..e7efb020 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip32.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip48.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip48.png new file mode 100644 index 00000000..491fbcac Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chip48.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chiperling96.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chiperling96.png new file mode 100644 index 00000000..477d4fb5 Binary files /dev/null and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/chiperling96.png differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png deleted file mode 100644 index f84f108d..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_16.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png deleted file mode 100644 index a9074f01..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_24.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png deleted file mode 100644 index 3c77d179..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_32.png and /dev/null differ diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png deleted file mode 100644 index 407f3b3e..00000000 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/logo_notext.png and /dev/null differ -- cgit v1.2.3 From 19d127f4c2d3b235db4ed060d9371f33674b7c86 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:04:27 +0000 Subject: version.xml prepare for release 1.2.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@466 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/src/main/jnlp/resources/version.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index e5f1d71c..451fe038 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,17 +2,17 @@ - BKUWebStart-1.2.3-SNAPSHOT.jar - 1.2.3-SNAPSHOT + BKUWebStart-1.2.3.jar + 1.2.3 - BKUWebStart-1.2.3-SNAPSHOT.jar + BKUWebStart-1.2.3.jar - utils-1.2.3-SNAPSHOT.jar - 1.2.3-SNAPSHOT + utils-1.2.3.jar + 1.2.3 - utils-1.2.3-SNAPSHOT.jar + utils-1.2.3.jar -- cgit v1.2.3 From 45bae5a2d8b414ccb3ed4421eeee867b2a6e88b7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:31:49 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@467 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 62a06f42..d2559543 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,7 +2,7 @@ bku at.gv.egiz - 1.2.3-SNAPSHOT + 1.2.3 4.0.0 at.gv.egiz @@ -13,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.2.3-SNAPSHOT + 1.2.3 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -224,7 +224,7 @@ at.gv.egiz BKULocal - 1.2.3-SNAPSHOT + 1.2.3 war @@ -235,7 +235,7 @@ utils at.gv.egiz - 1.2.3-SNAPSHOT + 1.2.3 iaik_ecc_signed -- cgit v1.2.3 From 1f0a54980e6b3f60c3b3d935f22537ceba179100 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:32:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@469 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index d2559543..462146d6 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,7 +2,7 @@ bku at.gv.egiz - 1.2.3 + 1.2.4-SNAPSHOT 4.0.0 at.gv.egiz @@ -13,7 +13,7 @@ | IMPORTANT: update jnlp/resources/version.xml (BKUWebStart and utils) and | include-webstart profile in BKUOnline if version changes |--> - 1.2.3 + 1.2.4-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -224,7 +224,7 @@ at.gv.egiz BKULocal - 1.2.3 + 1.2.4-SNAPSHOT war @@ -235,7 +235,7 @@ utils at.gv.egiz - 1.2.3 + 1.2.4-SNAPSHOT iaik_ecc_signed -- cgit v1.2.3 From f1f9ab678eb71a861737d47ec666413d4ad043f7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 17:07:21 +0000 Subject: icons 2.0 (logo->chip) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@470 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/jnlp/resources/img/version.xml | 24 +++++++++++----------- BKUWebStart/src/main/jnlp/template-local.xml | 16 +++++++-------- BKUWebStart/src/main/jnlp/template.xml | 16 +++++++-------- 3 files changed, 28 insertions(+), 28 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/jnlp/resources/img/version.xml b/BKUWebStart/src/main/jnlp/resources/img/version.xml index 826b58f6..5e160beb 100644 --- a/BKUWebStart/src/main/jnlp/resources/img/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/img/version.xml @@ -2,45 +2,45 @@ - logo16.png + chip16.png 2.0 - logo16.png + chip16.png - logo24.png + chip24.png 2.0 - logo24.png + chip24.png - logo32.png + chip32.png 2.0 - logo32.png + chip32.png - logo48.png + chip48.png 2.0 - logo48.png + chip48.png - logo64.png + chip64.png 2.0 - logo64.png + chip64.png - logo128.png + chip128.png 2.0 - logo128.png + chip128.png diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml index ab987cae..1b21c118 100644 --- a/BKUWebStart/src/main/jnlp/template-local.xml +++ b/BKUWebStart/src/main/jnlp/template-local.xml @@ -9,14 +9,14 @@ $project.Description (BKU) MOCCA Web Start $project.Description - - - - - - - - + + + + + + + + diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 23d9379a..a8ee0341 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -9,14 +9,14 @@ $project.Description (BKU) MOCCA Web Start $project.Description - - - - - - - - + + + + + + + + -- cgit v1.2.3 From 145003155c05e915b900989a27cef1271398164b Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 26 Aug 2009 17:31:32 +0000 Subject: MOCCA TLS Server CA cert installation servlet removed help.jsp (and jsp dependencies in jetty) moved html pages to src/main/webapp (encoding problem?) switch to BASIC download protocol in BKUWebStart (no jnlpDownloadServlet required, see template.xml) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@474 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 28 +-- .../java/at/gv/egiz/bku/webstart/Configurator.java | 2 +- .../java/at/gv/egiz/bku/webstart/Container.java | 210 +++++++++++++-------- .../java/at/gv/egiz/bku/webstart/Launcher.java | 7 +- .../java/at/gv/egiz/bku/webstart/TLSServerCA.java | 3 +- BKUWebStart/src/main/jnlp/resources/version.xml | 35 ---- BKUWebStart/src/main/jnlp/template.xml | 22 +-- 7 files changed, 164 insertions(+), 143 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 462146d6..cef65ac2 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -51,9 +51,11 @@ webstart-maven-plugin @@ -98,8 +100,8 @@ false - - true + false + false true true @@ -190,9 +192,6 @@ false - true - - true @@ -212,7 +211,6 @@ template-local.xml mocca-local.jnlp - false @@ -221,6 +219,14 @@ + at.gv.egiz BKULocal @@ -259,12 +265,12 @@ + | org.mortbay.jetty jsp-2.1-jetty 6.1.19 - + org.slf4j slf4j-api diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java index bef2246b..923a70d9 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java @@ -56,7 +56,7 @@ public class Configurator { * configurations with less than this (major) version will be backuped and updated * allowed: MAJOR[.MINOR[.X[-SNAPSHOT]]] */ - public static final String MIN_CONFIG_VERSION = "1.0.9"; + public static final String MIN_CONFIG_VERSION = "1.2.4-SNAPSHOT"; public static final String CONFIG_DIR = ".mocca/conf/"; public static final String CERTS_DIR = ".mocca/certs/"; public static final String VERSION_FILE = ".version"; diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index 08a0808a..3bf74d3c 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -2,9 +2,11 @@ package at.gv.egiz.bku.webstart; import at.gv.egiz.bku.utils.StreamUtil; import java.awt.AWTPermission; +import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FilePermission; @@ -15,8 +17,12 @@ import java.io.OutputStream; import java.lang.reflect.ReflectPermission; import java.net.NetPermission; import java.net.SocketPermission; +import java.security.AllPermission; +import java.security.KeyStore; import java.security.Permissions; import java.security.SecurityPermission; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; import java.util.PropertyPermission; import javax.smartcardio.CardPermission; import org.apache.commons.logging.Log; @@ -32,8 +38,9 @@ public class Container { public static final String HTTP_PORT_PROPERTY = "mocca.http.port"; public static final String HTTPS_PORT_PROPERTY = "mocca.http.port"; - + public static final String SERVER_CA_CERTIFICATE_ATTRIBUTE = "mocca.tls.server.ca.certificate"; private static Log log = LogFactory.getLog(Container.class); + static { if (log.isDebugEnabled()) { //Jetty log INFO and WARN, include ignored exceptions @@ -43,7 +50,6 @@ public class Container { //System.setProperty("DEBUG", "true"); } } - private Server server; public void init() throws IOException { @@ -75,63 +81,98 @@ public class Container { } log.debug("loading MOCCA keystore from " + keystoreFile.getAbsolutePath()); sslConnector.setKeystore(keystoreFile.getAbsolutePath()); - File passwdFile = new File(configDir, Configurator.PASSWD_FILE); - BufferedReader reader = new BufferedReader(new FileReader(passwdFile)); - String pwd; - while ((pwd = reader.readLine()) != null) { - sslConnector.setPassword(pwd); - sslConnector.setKeyPassword(pwd); - } - reader.close(); - + String passwd = readPassword(new File(configDir, Configurator.PASSWD_FILE)); + sslConnector.setPassword(passwd); + sslConnector.setKeyPassword(passwd); + //avoid jetty's ClassCastException: iaik.security.ecc.ecdsa.ECPublicKey cannot be cast to java.security.interfaces.ECPublicKey - String[] RFC4492CipherSuites = new String[] { + String[] RFC4492CipherSuites = new String[]{ "TLS_ECDH_ECDSA_WITH_NULL_SHA", - "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", - - "TLS_ECDHE_ECDSA_WITH_NULL_SHA", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - - "TLS_ECDH_RSA_WITH_NULL_SHA", - "TLS_ECDH_RSA_WITH_RC4_128_SHA", - "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", - - "TLS_ECDHE_RSA_WITH_NULL_SHA", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - - "TLS_ECDH_anon_WITH_NULL_SHA", - "TLS_ECDH_anon_WITH_RC4_128_SHA", - "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - "TLS_ECDH_anon_WITH_AES_256_CBC_SHA" + "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_NULL_SHA", + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_RSA_WITH_NULL_SHA", + "TLS_ECDH_RSA_WITH_RC4_128_SHA", + "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", + "TLS_ECDHE_RSA_WITH_NULL_SHA", + "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + "TLS_ECDH_anon_WITH_NULL_SHA", + "TLS_ECDH_anon_WITH_RC4_128_SHA", + "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", + "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", + "TLS_ECDH_anon_WITH_AES_256_CBC_SHA" }; sslConnector.setExcludeCipherSuites(RFC4492CipherSuites); - server.setConnectors(new Connector[] { connector, sslConnector }); - + server.setConnectors(new Connector[]{connector, sslConnector}); + WebAppContext webapp = new WebAppContext(); webapp.setLogUrlOnStart(true); webapp.setContextPath("/"); - webapp.setExtractWAR(true); + webapp.setExtractWAR(true); webapp.setParentLoaderPriority(false); + try { + // no way to get certificate from within the servlet (SSLEngine/Jetty SSLSocketConnector/SSLContext?) + if (log.isTraceEnabled()) { + log.trace("local ca certificate from " + keystoreFile + " in webapp context at " + SERVER_CA_CERTIFICATE_ATTRIBUTE); + } + BufferedInputStream bis = new BufferedInputStream(new FileInputStream(keystoreFile)); + KeyStore sslKeyStore = KeyStore.getInstance("JKS"); + sslKeyStore.load(bis, passwd.toCharArray()); + Certificate[] sslChain = sslKeyStore.getCertificateChain(TLSServerCA.MOCCA_TLS_SERVER_ALIAS); + webapp.setAttribute(SERVER_CA_CERTIFICATE_ATTRIBUTE, sslChain[sslChain.length - 1]); + bis.close(); + } catch (Exception ex) { + log.error("Failed to load local ca certificate", ex); + log.warn("automated web certificate installation will not be available"); + } + webapp.setWar(copyWebapp(webapp.getTempDirectory())); webapp.setPermissions(getPermissions(webapp.getTempDirectory())); - + server.setHandler(webapp); - server.setGracefulShutdown(1000*3); + server.setGracefulShutdown(1000 * 3); + } + + /** + * @return The first valid (not empty, no comment) line of the passwd file + * @throws IOException + */ + protected static String readPassword(File passwdFile) throws IOException { + if (passwdFile.exists() && passwdFile.canRead()) { + BufferedReader passwdReader = null; + try { + passwdReader = new BufferedReader(new FileReader(passwdFile)); + String passwd; + while ((passwd = passwdReader.readLine().trim()) != null) { + if (passwd.length() > 0 && !passwd.startsWith("#")) { + return passwd; + } + } + } catch (IOException ex) { + log.error("failed to read password from " + passwdFile, ex); + throw ex; + } finally { + try { + passwdReader.close(); + } catch (IOException ex) { + } + } + } + throw new IOException(passwdFile + " not readable"); } private String copyWebapp(File webappDir) throws IOException { @@ -146,43 +187,48 @@ public class Container { private Permissions getPermissions(File webappDir) { Permissions perms = new Permissions(); + perms.add(new AllPermission()); + + + if (false) { + + // jetty-webstart (spring?) + perms.add(new RuntimePermission("getClassLoader")); + + // standard permissions + perms.add(new PropertyPermission("*", "read,write")); + perms.add(new RuntimePermission("accessDeclaredMembers")); + perms.add(new RuntimePermission("accessClassInPackage.*")); + perms.add(new RuntimePermission("defineClassInPackage.*")); + perms.add(new RuntimePermission("setFactory")); + perms.add(new RuntimePermission("getProtectionDomain")); + perms.add(new RuntimePermission("modifyThread")); + perms.add(new RuntimePermission("modifyThreadGroup")); + perms.add(new RuntimePermission("setFactory")); + perms.add(new ReflectPermission("suppressAccessChecks")); + + // MOCCA specific + perms.add(new SocketPermission("*", "connect,resolve")); + perms.add(new NetPermission("specifyStreamHandler")); + perms.add(new SecurityPermission("insertProvider.*")); + perms.add(new SecurityPermission("putProviderProperty.*")); + perms.add(new SecurityPermission("removeProvider.*")); + perms.add(new CardPermission("*", "*")); + perms.add(new AWTPermission("*")); + + perms.add(new FilePermission(webappDir.getAbsolutePath() + "/-", "read")); + perms.add(new FilePermission(new File(System.getProperty("java.home") + "/lib/xalan.properties").getAbsolutePath(), "read")); + perms.add(new FilePermission(new File(System.getProperty("java.home") + "/lib/xerces.properties").getAbsolutePath(), "read")); + perms.add(new FilePermission(new File(System.getProperty("user.home")).getAbsolutePath(), "read, write")); + perms.add(new FilePermission(new File(System.getProperty("user.home") + "/-").getAbsolutePath(), "read, write")); + perms.add(new FilePermission(new File(System.getProperty("user.home") + "/.mocca/logs/*").getAbsolutePath(), "read, write,delete")); + perms.add(new FilePermission(new File(System.getProperty("user.home") + "/.mocca/certs/-").getAbsolutePath(), "read, write,delete")); + + //TODO +// log.trace("granting file read/write permission to MOCCA local"); +// perms.add(new FilePermission("<>", "read, write")); - // jetty-webstart (spring?) - perms.add(new RuntimePermission("getClassLoader")); - - // standard permissions - perms.add(new PropertyPermission("*", "read,write")); - perms.add(new RuntimePermission("accessDeclaredMembers")); - perms.add(new RuntimePermission("accessClassInPackage.*")); - perms.add(new RuntimePermission("defineClassInPackage.*")); - perms.add(new RuntimePermission("setFactory")); - perms.add(new RuntimePermission("getProtectionDomain")); - perms.add(new RuntimePermission("modifyThread")); - perms.add(new RuntimePermission("modifyThreadGroup")); - perms.add(new RuntimePermission("setFactory")); - perms.add(new ReflectPermission("suppressAccessChecks")); - - // MOCCA specific - perms.add(new SocketPermission("*", "connect,resolve")); - perms.add(new NetPermission("specifyStreamHandler")); - perms.add(new SecurityPermission("insertProvider.*")); - perms.add(new SecurityPermission("putProviderProperty.*")); - perms.add(new SecurityPermission("removeProvider.*")); - perms.add(new CardPermission("*", "*")); - perms.add(new AWTPermission("*")); - - perms.add(new FilePermission(webappDir.getAbsolutePath() + "/-", "read")); - perms.add(new FilePermission(new File(System.getProperty("java.home") + "/lib/xalan.properties").getAbsolutePath(), "read")); - perms.add(new FilePermission(new File(System.getProperty("java.home") + "/lib/xerces.properties").getAbsolutePath(), "read")); - perms.add(new FilePermission(new File(System.getProperty("user.home")).getAbsolutePath(), "read, write")); - perms.add(new FilePermission(new File(System.getProperty("user.home") + "/-").getAbsolutePath(), "read, write")); - perms.add(new FilePermission(new File(System.getProperty("user.home") + "/.mocca/logs/*").getAbsolutePath(), "read, write,delete")); - perms.add(new FilePermission(new File(System.getProperty("user.home") + "/.mocca/certs/-").getAbsolutePath(), "read, write,delete")); - - //TODO - log.trace("granting file read/write permission to MOCCA local"); - perms.add(new FilePermission("<>", "read, write")); - + } return perms; } @@ -205,4 +251,4 @@ public class Container { public void join() throws InterruptedException { server.join(); } -} \ No newline at end of file +} 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 0cfc14e5..0106de62 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 @@ -27,6 +27,7 @@ import java.awt.event.WindowAdapter; import java.net.BindException; import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.URI; import java.net.URL; import java.security.GeneralSecurityException; import java.util.jar.Attributes; @@ -73,21 +74,25 @@ public class Launcher implements BKUControllerInterface, ActionListener { /** local bku uri */ public static final URL HTTP_SECURITY_LAYER_URL; public static final URL HTTPS_SECURITY_LAYER_URL; + public static final URL INSTALL_CERT_URL; public static final URL PIN_MANAGEMENT_URL; static { URL http = null; URL https = null; URL pin = null; + URL cert = null; try { 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"); + cert = new URL(http, "/installCertificate"); } catch (MalformedURLException ex) { log.error(ex); } finally { HTTP_SECURITY_LAYER_URL = http; HTTPS_SECURITY_LAYER_URL = https; PIN_MANAGEMENT_URL = pin; + INSTALL_CERT_URL = cert; } } public static final String version; @@ -273,7 +278,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { Desktop desktop = Desktop.getDesktop(); if (desktop.isSupported(Desktop.Action.BROWSE)) { try { - desktop.browse(HTTPS_SECURITY_LAYER_URL.toURI()); + desktop.browse(HTTP_SECURITY_LAYER_URL.toURI()); } catch (Exception ex) { log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URL, ex); } diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java index 97ca716b..fd94958e 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java @@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory; public class TLSServerCA { public static final int CA_VALIDITY_Y = 3; + public static final String MOCCA_TLS_SERVER_ALIAS = "server"; public static final int SERVER_VALIDITY_Y = 3; private final static Log log = LogFactory.getLog(TLSServerCA.class); @@ -127,7 +128,7 @@ public class TLSServerCA { generateServerCert(); KeyStore ks = KeyStore.getInstance("JKS"); ks.load(null, null); - ks.setKeyEntry("server", serverKeyPair.getPrivate(), password, new X509Certificate[]{serverCert, caCert}); + ks.setKeyEntry(MOCCA_TLS_SERVER_ALIAS, serverKeyPair.getPrivate(), password, new X509Certificate[]{serverCert, caCert}); return ks; // } catch (Exception e) { // log.error("Cannot generate certificate", e); diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 451fe038..5e504b68 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -89,41 +89,6 @@ servlet-api-2.5-20081211.jar - - - jsp-2.1-jetty-6.1.19.jar - 6.1.19 - - jsp-2.1-jetty-6.1.19.jar - - - - jsp-2.1-glassfish-9.1.1.B60.25.p0.jar - 9.1.1.B60.25.p0 - - jsp-2.1-glassfish-9.1.1.B60.25.p0.jar - - - - jsp-api-2.1-glassfish-9.1.1.B60.25.p0.jar - 9.1.1.B60.25.p0 - - jsp-api-2.1-glassfish-9.1.1.B60.25.p0.jar - - - - ant-1.6.5.jar - 1.6.5 - - ant-1.6.5.jar - - - - core-3.1.1.jar - 3.1.1 - - core-3.1.1.jar - slf4j-api-1.5.8.jar diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index a8ee0341..8181bc31 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -1,5 +1,5 @@ - + @@ -9,15 +9,15 @@ $project.Description (BKU) MOCCA Web Start $project.Description - - - - - - - - - + + + + + + + + + @@ -39,13 +39,11 @@ - $dependencies - $dependencies -- cgit v1.2.3 From 234cc16c3ebee52e7b3b76219b94d6ee644d5775 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 16:00:46 +0000 Subject: added HELP tray item added INSTALL CA CERT help page WebStart: shortcut online=true git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@476 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/webstart/Launcher.java | 56 ++++++++++++++++------ BKUWebStart/src/main/jnlp/template-local.xml | 2 +- BKUWebStart/src/main/jnlp/template.xml | 2 +- .../at/gv/egiz/bku/webstart/messages.properties | 2 + 4 files changed, 45 insertions(+), 17 deletions(-) (limited to 'BKUWebStart') 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 0106de62..8cc9817f 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 @@ -5,9 +5,12 @@ import at.gv.egiz.bku.webstart.gui.BKUControllerInterface; 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; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.jnlp.UnavailableServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -30,6 +33,7 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.security.GeneralSecurityException; +import java.text.MessageFormat; import java.util.jar.Attributes; import java.util.jar.Manifest; import javax.imageio.ImageIO; @@ -39,6 +43,7 @@ import javax.swing.JFrame; import org.mortbay.util.MultiException; public class Launcher implements BKUControllerInterface, ActionListener { + public static final String HELP_COMMAND = "help"; public static final String WEBAPP_RESOURCE = "BKULocal.war"; public static final String CERTIFICATES_RESOURCE = "BKUCertificates.jar"; @@ -59,8 +64,10 @@ public class Launcher implements BKUControllerInterface, ActionListener { 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 ERROR_OPEN_URL = "tray.error.open.url"; public static final String LABEL_SHUTDOWN = "tray.label.shutdown"; public static final String LABEL_PIN = "tray.label.pin"; + public static final String LABEL_HELP = "tray.label.help"; public static final String LABEL_ABOUT = "tray.label.about"; public static final String TOOLTIP_DEFAULT = "tray.tooltip.default"; @@ -76,16 +83,19 @@ public class Launcher implements BKUControllerInterface, ActionListener { public static final URL HTTPS_SECURITY_LAYER_URL; public static final URL INSTALL_CERT_URL; public static final URL PIN_MANAGEMENT_URL; + public static final URL HELP_URL; static { URL http = null; URL https = null; URL pin = null; URL cert = null; + URL help = null; try { 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"); cert = new URL(http, "/installCertificate"); + help = new URL(http, "/help"); } catch (MalformedURLException ex) { log.error(ex); } finally { @@ -93,6 +103,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { HTTPS_SECURITY_LAYER_URL = https; PIN_MANAGEMENT_URL = pin; INSTALL_CERT_URL = cert; + HELP_URL = help; } } public static final String version; @@ -170,6 +181,18 @@ public class Launcher implements BKUControllerInterface, ActionListener { throw ex; } } + + private void browse(URL url) throws IOException, URISyntaxException { + // don't use basicService.showDocument(), which causes a java ssl warning dialog + if (Desktop.isDesktopSupported()) { + Desktop desktop = Desktop.getDesktop(); + if (desktop.isSupported(Desktop.Action.BROWSE)) { + desktop.browse(url.toURI()); + return; + } + } + throw new IOException("current platform does not support Java Desktop API"); + } private TrayIcon initTrayIcon() { if (SystemTray.isSupported()) { @@ -192,6 +215,11 @@ public class Launcher implements BKUControllerInterface, ActionListener { PopupMenu popup = new PopupMenu(); + MenuItem helpItem = new MenuItem(messages.getString(LABEL_HELP)); + helpItem.addActionListener(this); + helpItem.setActionCommand(HELP_COMMAND); + popup.add(helpItem); + MenuItem pinItem = new MenuItem(messages.getString(LABEL_PIN)); pinItem.addActionListener(this); pinItem.setActionCommand(PIN_COMMAND); @@ -273,20 +301,10 @@ public class Launcher implements BKUControllerInterface, ActionListener { } } if (config.isCertRenewed()) { - // don't use basicService.showDocument(), which causes a java ssl warning dialog - if (Desktop.isDesktopSupported()) { - Desktop desktop = Desktop.getDesktop(); - if (desktop.isSupported(Desktop.Action.BROWSE)) { - try { - desktop.browse(HTTP_SECURITY_LAYER_URL.toURI()); - } catch (Exception 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_URL); - } - } else { - log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URL); + try { + browse(HTTP_SECURITY_LAYER_URL); + } catch (Exception ex) { + log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URL, ex); } } log.info("BKU successfully started"); @@ -344,7 +362,15 @@ public class Launcher implements BKUControllerInterface, ActionListener { log.debug("pin management dialog requested via tray menu"); new Thread(new PINManagementInvoker(trayIcon, messages)).start(); - + } else if (HELP_COMMAND.equals(e.getActionCommand())) { + log.debug("help page requested via tray menu"); + try { + browse(HELP_URL); + } catch (Exception ex) { + log.error("Failed to open " + HELP_URL, ex); + String msg = MessageFormat.format(messages.getString(ERROR_OPEN_URL), HELP_URL); + trayIcon.displayMessage(messages.getString(CAPTION_ERROR), msg, TrayIcon.MessageType.ERROR); + } } else { log.error("unknown tray menu command: " + e.getActionCommand()); } diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml index 1b21c118..3193255a 100644 --- a/BKUWebStart/src/main/jnlp/template-local.xml +++ b/BKUWebStart/src/main/jnlp/template-local.xml @@ -18,7 +18,7 @@ - + diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml index 8181bc31..790e60e1 100644 --- a/BKUWebStart/src/main/jnlp/template.xml +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -18,7 +18,7 @@ - + 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 b6d9238e..9ba359be 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 @@ -25,8 +25,10 @@ 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.error.open.url=Verbindung zu {0} konnte nicht hergestellt werden tray.label.shutdown=Beenden tray.label.pin=PIN Verwaltung +tray.label.help=Hilfe tray.label.about=\u00DCber... tray.tooltip.default=B\u00FCrgerkartenumgebung about.frame.title=B\u00FCrgerkarte -- cgit v1.2.3 From 0acb5643e945daf024c0dec04f0ad86d6427b7b0 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:02:15 +0000 Subject: seperate BKUWebStart main jar and BKUWebStart bundle use webstart-maven-plugin:jnlp-download-servlet goal to get versions right git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@477 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/jnlp/resources/img/chip128.png | Bin 7775 -> 0 bytes BKUWebStart/src/main/jnlp/resources/img/chip16.png | Bin 787 -> 0 bytes BKUWebStart/src/main/jnlp/resources/img/chip24.png | Bin 1227 -> 0 bytes BKUWebStart/src/main/jnlp/resources/img/chip32.png | Bin 1753 -> 0 bytes BKUWebStart/src/main/jnlp/resources/img/chip48.png | Bin 2771 -> 0 bytes BKUWebStart/src/main/jnlp/resources/img/splash.png | Bin 41455 -> 0 bytes .../src/main/jnlp/resources/img/version.xml | 52 --------- BKUWebStart/src/main/jnlp/resources/player.jnlp | 3 - BKUWebStart/src/main/jnlp/resources/version.xml | 129 --------------------- BKUWebStart/src/main/jnlp/template-local.xml | 46 -------- BKUWebStart/src/main/jnlp/template.xml | 51 -------- 11 files changed, 281 deletions(-) delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip128.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip16.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip24.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip32.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip48.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/splash.png delete mode 100644 BKUWebStart/src/main/jnlp/resources/img/version.xml delete mode 100644 BKUWebStart/src/main/jnlp/resources/player.jnlp delete mode 100644 BKUWebStart/src/main/jnlp/resources/version.xml delete mode 100644 BKUWebStart/src/main/jnlp/template-local.xml delete mode 100644 BKUWebStart/src/main/jnlp/template.xml (limited to 'BKUWebStart') diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip128.png b/BKUWebStart/src/main/jnlp/resources/img/chip128.png deleted file mode 100644 index c36d8079..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/chip128.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip16.png b/BKUWebStart/src/main/jnlp/resources/img/chip16.png deleted file mode 100644 index 96b580e9..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/chip16.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip24.png b/BKUWebStart/src/main/jnlp/resources/img/chip24.png deleted file mode 100644 index efd6dbeb..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/chip24.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip32.png b/BKUWebStart/src/main/jnlp/resources/img/chip32.png deleted file mode 100644 index e7efb020..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/chip32.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/chip48.png b/BKUWebStart/src/main/jnlp/resources/img/chip48.png deleted file mode 100644 index 491fbcac..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/chip48.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/splash.png b/BKUWebStart/src/main/jnlp/resources/img/splash.png deleted file mode 100644 index 597fbc60..00000000 Binary files a/BKUWebStart/src/main/jnlp/resources/img/splash.png and /dev/null differ diff --git a/BKUWebStart/src/main/jnlp/resources/img/version.xml b/BKUWebStart/src/main/jnlp/resources/img/version.xml deleted file mode 100644 index 5e160beb..00000000 --- a/BKUWebStart/src/main/jnlp/resources/img/version.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - chip16.png - 2.0 - - chip16.png - - - - chip24.png - 2.0 - - chip24.png - - - - chip32.png - 2.0 - - chip32.png - - - - chip48.png - 2.0 - - chip48.png - - - - chip64.png - 2.0 - - chip64.png - - - - chip128.png - 2.0 - - chip128.png - - - - splash.png - 2.0 - - splash.png - - diff --git a/BKUWebStart/src/main/jnlp/resources/player.jnlp b/BKUWebStart/src/main/jnlp/resources/player.jnlp deleted file mode 100644 index da08ebc2..00000000 --- a/BKUWebStart/src/main/jnlp/resources/player.jnlp +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml deleted file mode 100644 index 5e504b68..00000000 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - BKUWebStart-1.2.3.jar - 1.2.3 - - BKUWebStart-1.2.3.jar - - - - utils-1.2.3.jar - 1.2.3 - - utils-1.2.3.jar - - - - BKUCertificates-1.0.jar - 1.0 - - BKUCertificates-1.0.jar - - - - - commons-logging-1.1.1.jar - 1.1.1 - - commons-logging-1.1.1.jar - - - - - activation-1.1.jar - 1.1 - - activation-1.1.jar - - - - - log4j-1.2.12.jar - 1.2.12 - - log4j-1.2.12.jar - - - - - iaik_ecc_signed-2.15.jar - 2.15 - - iaik_ecc_signed-2.15.jar - - - - iaik_jce_full_signed-3.16.jar - 3.16 - - iaik_jce_full_signed-3.16.jar - - - - iaik_xsect-1.14.jar - 1.14 - - iaik_xsect-1.14.jar - - - - - jetty-6.1.19.jar - 6.1.19 - - jetty-6.1.19.jar - - - - jetty-util-6.1.19.jar - 6.1.19 - - jetty-util-6.1.19.jar - - - - servlet-api-2.5-20081211.jar - 2.5-20081211 - - servlet-api-2.5-20081211.jar - - - - slf4j-api-1.5.8.jar - 1.5.8 - - slf4j-api-1.5.8.jar - - - - slf4j-log4j12-1.5.8.jar - 1.5.8 - - slf4j-log4j12-1.5.8.jar - - - - - jaxb-api-2.1.jar - 2.1 - - jaxb-api-2.1.jar - - - - jaxb-impl-2.1.9.jar - 2.1.9 - - jaxb-impl-2.1.9.jar - - - - stax-api-1.0-2.jar - 1.0-2 - - stax-api-1.0-2.jar - - - diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml deleted file mode 100644 index 3193255a..00000000 --- a/BKUWebStart/src/main/jnlp/template-local.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - $project.Description - - E-Government Innovationszentrum (EGIZ) - - $project.Description (BKU) MOCCA Web Start - $project.Description - - - - - - - - - - - - - - -#if($offlineAllowed) - -#end - - - -#if($allPermissions) - - - -#end - - - - - - $dependencies - - - - \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml deleted file mode 100644 index 790e60e1..00000000 --- a/BKUWebStart/src/main/jnlp/template.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - $project.Description - - E-Government Innovationszentrum (EGIZ) - - $project.Description (BKU) MOCCA Web Start - $project.Description - - - - - - - - - - - - - - -#if($offlineAllowed) - -#end - - - -#if($allPermissions) - - - -#end - - - - - - $dependencies - - - - - $dependencies - - - - \ No newline at end of file -- cgit v1.2.3 From 49439f0912a2f0e23cf4bcf63967d177658a837c Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:02:45 +0000 Subject: seperate BKUWebStart main jar and BKUWebStart bundle use webstart-maven-plugin:jnlp-download-servlet goal to get versions right git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@478 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 142 ++-------------------------------------------------- 1 file changed, 4 insertions(+), 138 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index cef65ac2..d6369dec 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -9,10 +9,6 @@ BKUWebStart jar BKU Web Start - 1.2.4-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -39,6 +35,7 @@ at.gv.egiz BKULocal + ${project.version} war false ${project.build.directory}/classes @@ -50,64 +47,6 @@ - - - webstart-maven-plugin - org.codehaus.mojo.webstart - - - - package - - - jnlp-inline - - - - - false - - - ${project.basedir}/src/main/jnlp - template.xml - mocca.jnlp - at.gv.egiz.bku.webstart.Launcher - 1.6+ - true - true - - - test-applet signer - ${project.basedir}/keystore.ks - - storepass - keypass - true - - false - false - - - false - false - false - - true - true - - - maven-buildnumber-plugin org.codehaus.mojo @@ -143,81 +82,6 @@ - - - standalone (non-webstart) - - - - maven-jar-plugin - org.apache.maven.plugins - - - - true - at.gv.egiz.bku.webstart.Launcher - - - development - ${pom.url} - at/gv/egiz/bku/webstart/splash.png - - - - - - - - - - - pkcs11-sign - - - - webstart-maven-plugin - org.codehaus.mojo.webstart - - 1.0-beta-1-mocca - - - NONE - PKCS11 - iaik.pkcs.pkcs11.provider.IAIKPkcs11 - a-sit - ${pkcs11-pass} - true - - false - false - - - - - - - - - - - local-webstart - - - - webstart-maven-plugin - org.codehaus.mojo.webstart - - - template-local.xml - mocca-local.jnlp - - - - - - - - + provided at.gv.egiz -- cgit v1.2.3 From 6d515d832b0c0828a63d0b68d7823054543761ff Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:32:15 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.4 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@479 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index d6369dec..27af82c1 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.4-SNAPSHOT + 1.2.4 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.4-SNAPSHOT + 1.2.4 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -107,7 +107,7 @@ utils at.gv.egiz - 1.2.4-SNAPSHOT + 1.2.4 iaik_ecc_signed -- cgit v1.2.3 From 5eb05982f2e98f56569b4ea07b1961e3eed617d7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:32:33 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@481 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 27af82c1..de0e0f4a 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.4 + 1.2.5-SNAPSHOT 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.4 + 1.2.5-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -107,7 +107,7 @@ utils at.gv.egiz - 1.2.4 + 1.2.5-SNAPSHOT iaik_ecc_signed -- cgit v1.2.3 From dd04951a76fc6406755a94ecf547c0797f062fa2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 17:53:01 +0000 Subject: replace installCertificate servlet with der encoded crt file in webapp/ moved local-webstart profile to BKUWebStart (jnlp-inline goal) help note for internet explorer on visat/7 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@482 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/keystore.ks | Bin 5635 -> 0 bytes BKUWebStart/pom.xml | 48 +++++++++++++++++++ .../java/at/gv/egiz/bku/webstart/Container.java | 47 +++++++++++-------- .../java/at/gv/egiz/bku/webstart/Launcher.java | 6 +-- .../java/at/gv/egiz/bku/webstart/TLSServerCA.java | 10 ++-- BKUWebStart/src/main/jnlp/keystore.ks | Bin 0 -> 5635 bytes .../src/main/jnlp/resources/img/chip128.png | Bin 0 -> 7775 bytes BKUWebStart/src/main/jnlp/resources/img/chip16.png | Bin 0 -> 787 bytes BKUWebStart/src/main/jnlp/resources/img/chip24.png | Bin 0 -> 1227 bytes BKUWebStart/src/main/jnlp/resources/img/chip32.png | Bin 0 -> 1753 bytes BKUWebStart/src/main/jnlp/resources/img/chip48.png | Bin 0 -> 2771 bytes BKUWebStart/src/main/jnlp/resources/img/splash.png | Bin 0 -> 41455 bytes .../src/main/jnlp/resources/img/version.xml | 52 +++++++++++++++++++++ BKUWebStart/src/main/jnlp/resources/player.jnlp | 3 ++ BKUWebStart/src/main/jnlp/template-local.xml | 40 ++++++++++++++++ 15 files changed, 180 insertions(+), 26 deletions(-) delete mode 100644 BKUWebStart/keystore.ks create mode 100644 BKUWebStart/src/main/jnlp/keystore.ks create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip128.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip16.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip24.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip32.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/chip48.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/splash.png create mode 100644 BKUWebStart/src/main/jnlp/resources/img/version.xml create mode 100644 BKUWebStart/src/main/jnlp/resources/player.jnlp create mode 100644 BKUWebStart/src/main/jnlp/template-local.xml (limited to 'BKUWebStart') diff --git a/BKUWebStart/keystore.ks b/BKUWebStart/keystore.ks deleted file mode 100644 index 824c3a40..00000000 Binary files a/BKUWebStart/keystore.ks and /dev/null differ diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index de0e0f4a..90d93566 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -82,6 +82,54 @@ + + + + local-webstart + + + + webstart-maven-plugin + org.codehaus.mojo.webstart + + + package + + jnlp-inline + + + + + false + + ${project.basedir}/src/main/jnlp + template-local.xml + mocca-local.jnlp + at.gv.egiz.bku.webstart.Launcher + + + test-applet signer + ${project.basedir}/src/main/jnlp/keystore.ks + storepass + keypass + true + + false + false + + + false + false + false + true + true + + + + + + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml new file mode 100644 index 00000000..12ff9d8c --- /dev/null +++ b/BKUWebStart/src/main/jnlp/template-local.xml @@ -0,0 +1,40 @@ + + + + + ${project.Description} + E-Government Innovationszentrum (EGIZ) + + ${project.Description} (BKU) MOCCA Web Start + ${project.Description} + + + + + + + + + + + + + + + + + + + + + + + + + + + $dependencies + + + + \ No newline at end of file -- cgit v1.2.3 From e1dc0aba428324581adb37450856c7d4ae93fcc6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 19:08:45 +0000 Subject: unpack-dependencies instead of unpack git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@487 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 90d93566..9f25fae6 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -28,19 +28,13 @@ copy-resources - copy + copy-dependencies - - - at.gv.egiz - BKULocal - ${project.version} - war - false - ${project.build.directory}/classes - - + BKULocal + at.gv.egiz + META-INF/ + ${project.build.directory}/classes true -- cgit v1.2.3 From 44ee3259546bdcfbdc54563aa2766cce3f5cd704 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 20:13:07 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@488 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 9f25fae6..0ea896ac 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.5-SNAPSHOT + 1.2.5 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.5-SNAPSHOT + 1.2.5 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -149,7 +149,7 @@ utils at.gv.egiz - 1.2.5-SNAPSHOT + 1.2.5 iaik_ecc_signed -- cgit v1.2.3 From 68ebb57a05d44b25b886749719e7bd9997b0bd11 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 20:16:01 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@490 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 0ea896ac..4ceba0b8 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.5 + 1.2.6-SNAPSHOT 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.5 + 1.2.6-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -149,7 +149,7 @@ utils at.gv.egiz - 1.2.5 + 1.2.6-SNAPSHOT iaik_ecc_signed -- cgit v1.2.3 From 025657248e87001b91a5eb90cdc24fb20bc2c62b Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 9 Sep 2009 07:54:21 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.6 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@506 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 4ceba0b8..06c269d3 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.6-SNAPSHOT + 1.2.6 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.6-SNAPSHOT + 1.2.6 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -149,7 +149,7 @@ utils at.gv.egiz - 1.2.6-SNAPSHOT + 1.2.6 iaik_ecc_signed -- cgit v1.2.3 From ce450c6eee4977040072b5f51a91183c15846b1a Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 9 Sep 2009 07:54:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@508 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 06c269d3..18652eec 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.6 + 1.2.7-SNAPSHOT 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.6 + 1.2.7-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -149,7 +149,7 @@ utils at.gv.egiz - 1.2.6 + 1.2.7-SNAPSHOT iaik_ecc_signed -- cgit v1.2.3 From 9d4b3e9214f653d2556608958642d02814d4e7a3 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 28 Sep 2009 14:38:07 +0000 Subject: non-webstart profile to BKUWebStart (removed from BKUWebStartPackage) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@509 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 18652eec..ca19a0b3 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -122,6 +122,32 @@ + + + non-webstart + + + + maven-jar-plugin + org.apache.maven.plugins + + + + true + at.gv.egiz.bku.webstart.Launcher + + + development + ${pom.url} + at/gv/egiz/bku/webstart/splash.png + + + + + + + + -- cgit v1.2.3 From bd070e82c276afb8c1c3a9ddc3b5712783760881 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 29 Sep 2009 17:36:06 +0000 Subject: Logging issues fixed: - Added possibility to configure logging of BKUWebstart. Logging is now configured from log4j configuration deployed with BKUWebstart in a first step. In a second step the webstart launcher looks for a log4j configuration file in the user's mooca configuration directory and updates the log4j configuration. - Logging of IAIK PKI properly initialized. IAIK PKI does not mess with the log4j configuration any longer. - Changed log4j accordingly (an appender is now needed as IAIK PKI does not reconfigure log4j any longer). Added css-stylesheet to ErrorResponses issued by the BKU to improve the presentation to the user. Changed dependencies of BKUWebStart (see Issue#469 https://egovlabs.gv.at/tracker/index.php?func=detail&aid=469&group_id=13&atid=134). DataURLConnection now uses the request encoding of SL < 1.2. application/x-www-form-urlencoded is now used as default encoding method. multipart/form-data is used only if transfer parameters are present in the request that require a Content-Type parameter. This can only be set with multipart/form-data. This is not in conformance with SL 1.2, however it should improve compatibility with applications. Therefore, removed the ability to configure the DataURLConnection implementation class. DataURLConnection now uses a streaming implementation for encoding of application/x-www-form-urlencoded requests. XWWWFormUrlImputDecoder now uses a streaming implementation for decoding of application/x-www-form-urlencoded requests. Fixed Bug in SLResultPart that caused a binary response to be provided as parameter "XMLResponse" in a multipart/form-data encoded request to DataURL. SLCommandFactory now supports unmarshalling of SL < 1.2 requests in order issue meaningful error messages. Therefore, the marshaling context for response marshaling had to be separated from the marshaling context for requests in order to avoid the marshaling of SL < 1.2 namespace prefixes in SL 1.2 responses. Target attribute in QualifiedProperties is now marshaled. (see Issue#470 https://egovlabs.gv.at/tracker/index.php?func=detail&aid=470&group_id=13&atid=134) Reporting of XML validation errors improved. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@510 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 14 +++++++++++- .../java/at/gv/egiz/bku/webstart/Configurator.java | 26 ++++++++++++++-------- .../java/at/gv/egiz/bku/webstart/Container.java | 11 ++++----- .../java/at/gv/egiz/bku/webstart/Launcher.java | 22 +++++++++--------- .../gv/egiz/bku/webstart/LogSecurityManager.java | 9 +++++--- .../java/at/gv/egiz/bku/webstart/TLSServerCA.java | 9 ++++---- .../at/gv/egiz/bku/webstart/gui/AboutDialog.java | 7 ++++-- .../bku/webstart/gui/PINManagementInvoker.java | 7 +++--- BKUWebStart/src/main/resources/log4j.properties | 20 +++++------------ .../at/gv/egiz/bku/webstart/ConfiguratorTest.java | 2 -- 10 files changed, 73 insertions(+), 54 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index ca19a0b3..f51f1332 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -172,6 +172,12 @@ BKUCertificates 1.0 + + iaik + iaik_jce_full_signed + compile + + + @@ -215,6 +222,11 @@ slf4j-log4j12 1.5.8 + + log4j + log4j + compile + diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java index 923a70d9..d8fe3e70 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java @@ -16,8 +16,9 @@ */ package at.gv.egiz.bku.webstart; -import at.gv.egiz.bku.utils.StreamUtil; import iaik.asn1.CodingException; +import iaik.utils.StreamCopier; + import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; @@ -42,8 +43,10 @@ import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; + +import org.apache.log4j.PropertyConfigurator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -71,7 +74,7 @@ public class Configurator { public static final String KEYSTORE_FILE = "keystore.ks"; public static final String PASSWD_FILE = ".secret"; - private static final Log log = LogFactory.getLog(Configurator.class); + private static final Logger log = LoggerFactory.getLogger(Configurator.class); /** currently installed configuration version */ private String version; @@ -110,6 +113,11 @@ public class Configurator { } else { initConfig(configDir); } + // re-configure logging + // TODO: move to appropriate place + String log4jconfig = configDir.getPath() + File.separatorChar + "log4j.properties"; + log.debug("Reconfiguring logging with " + log4jconfig); + PropertyConfigurator.configureAndWatch(log4jconfig); } /** @@ -312,7 +320,7 @@ public class Configurator { ZipEntry entry = new ZipEntry(relativePath.toString()); zip.putNextEntry(entry); BufferedInputStream entryIS = new BufferedInputStream(new FileInputStream(dir)); - StreamUtil.copyStream(entryIS, zip); + new StreamCopier(entryIS, zip).copyStream(); entryIS.close(); zip.closeEntry(); dir.delete(); @@ -341,7 +349,7 @@ public class Configurator { File confTemplateFile = new File(configDir, CONF_TEMPLATE_FILE); InputStream is = Configurator.class.getClassLoader().getResourceAsStream(CONF_TEMPLATE_RESOURCE); OutputStream os = new BufferedOutputStream(new FileOutputStream(confTemplateFile)); - StreamUtil.copyStream(is, os); + new StreamCopier(is, os).copyStream(); os.close(); unzip(confTemplateFile, configDir); confTemplateFile.delete(); @@ -374,7 +382,7 @@ public class Configurator { new File(certsDir, f.substring(0, f.lastIndexOf('/'))).mkdirs(); BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(certsDir, f))); log.debug(f); - StreamUtil.copyStream(Configurator.class.getClassLoader().getResourceAsStream(entry), bos); + new StreamCopier(Configurator.class.getClassLoader().getResourceAsStream(entry), bos).copyStream(); bos.close(); } else { log.trace("ignore " + entry); @@ -399,8 +407,8 @@ public class Configurator { } File f = new File(eF.getParent()); f.mkdirs(); - StreamUtil.copyStream(zipFile.getInputStream(entry), - new FileOutputStream(eF)); + new StreamCopier(zipFile.getInputStream(entry), + new FileOutputStream(eF)).copyStream(); } zipFile.close(); } diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java index 2feae267..4d1fe658 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java @@ -1,6 +1,7 @@ package at.gv.egiz.bku.webstart; -import at.gv.egiz.bku.utils.StreamUtil; +import iaik.utils.StreamCopier; + import java.awt.AWTPermission; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; @@ -24,20 +25,20 @@ import java.security.SecurityPermission; import java.security.cert.Certificate; import java.util.PropertyPermission; import javax.smartcardio.CardPermission; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.mortbay.jetty.Connector; import org.mortbay.jetty.Server; import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.security.SslSocketConnector; import org.mortbay.jetty.webapp.WebAppContext; import org.mortbay.thread.QueuedThreadPool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Container { public static final String HTTP_PORT_PROPERTY = "mocca.http.port"; public static final String HTTPS_PORT_PROPERTY = "mocca.http.port"; - private static Log log = LogFactory.getLog(Container.class); + private static Logger log = LoggerFactory.getLogger(Container.class); static { if (log.isDebugEnabled()) { @@ -166,7 +167,7 @@ public class Container { log.debug("copying BKULocal classpath resource to " + webapp); InputStream is = getClass().getClassLoader().getResourceAsStream("BKULocal.war"); OutputStream os = new BufferedOutputStream(new FileOutputStream(webapp)); - StreamUtil.copyStream(is, os); + new StreamCopier(is, os).copyStream(); os.close(); return webapp.getPath(); } 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 2bf42ccb..ef7edef1 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 @@ -10,8 +10,6 @@ import java.util.Locale; import java.util.ResourceBundle; import javax.jnlp.UnavailableServiceException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import com.sun.javaws.security.JavaWebStartSecurity; import java.awt.AWTException; @@ -37,6 +35,8 @@ import javax.jnlp.BasicService; import javax.jnlp.ServiceManager; import javax.swing.JFrame; import org.mortbay.util.MultiException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Launcher implements BKUControllerInterface, ActionListener { public static final String HELP_COMMAND = "help"; @@ -71,9 +71,10 @@ public class Launcher implements BKUControllerInterface, ActionListener { public static final String SHUTDOWN_COMMAND = "shutdown"; public static final String PIN_COMMAND = "pin"; public static final String ABOUT_COMMAND = "about"; + + private static Logger log = LoggerFactory.getLogger(Launcher.class); - 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; @@ -93,7 +94,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { cert = new URL(http, "/installCertificate"); help = new URL(http, "/help"); } catch (MalformedURLException ex) { - log.error(ex); + log.error("Failed to create URL.", ex); } finally { HTTP_SECURITY_LAYER_URL = http; HTTPS_SECURITY_LAYER_URL = https; @@ -132,6 +133,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { public Launcher() { + log.info("Initializing Launcher"); if (log.isTraceEnabled()) { SecurityManager sm = System.getSecurityManager(); if (sm instanceof JavaWebStartSecurity) { @@ -147,7 +149,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { try { initConfig(); } catch (Exception ex) { - log.fatal("Failed to initialize configuration", ex); + log.error("Failed to initialize configuration", ex); trayIcon.displayMessage(messages.getString(CAPTION_ERROR), messages.getString(ERROR_CONFIG), TrayIcon.MessageType.ERROR); throw ex; @@ -156,12 +158,12 @@ public class Launcher implements BKUControllerInterface, ActionListener { startServer(); initFinished(); } catch (BindException ex) { - log.fatal("Failed to launch server, " + ex.getMessage(), ex); + log.error("Failed to launch server, " + ex.getMessage(), ex); trayIcon.displayMessage(messages.getString(CAPTION_ERROR), messages.getString(ERROR_BIND), TrayIcon.MessageType.ERROR); throw ex; } catch (MultiException ex) { - log.fatal("Failed to launch server, " + ex.getMessage(), ex); + log.error("Failed to launch server, " + ex.getMessage(), ex); if (ex.getThrowable(0) instanceof BindException) { trayIcon.displayMessage(messages.getString(CAPTION_ERROR), messages.getString(ERROR_BIND), TrayIcon.MessageType.ERROR); @@ -172,7 +174,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { throw ex; } catch (Exception ex) { ex.printStackTrace(); - log.fatal("Failed to launch server, " + ex.getMessage(), ex); + log.error("Failed to launch server, " + ex.getMessage(), ex); trayIcon.displayMessage(messages.getString(CAPTION_ERROR), messages.getString(ERROR_START), TrayIcon.MessageType.ERROR); throw ex; @@ -379,7 +381,7 @@ public class Launcher implements BKUControllerInterface, ActionListener { launcher.launch(); } catch (Exception ex) { ex.printStackTrace(); - log.debug(ex); + log.debug("Caught exception " + ex.getMessage(), ex); log.info("waiting to shutdown..."); Thread.sleep(5000); log.info("exit"); diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java index 99fd403b..d589812e 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/LogSecurityManager.java @@ -20,8 +20,9 @@ import com.sun.javaws.security.JavaWebStartSecurity; import java.io.FileDescriptor; import java.net.InetAddress; import java.security.Permission; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JVM argument -Djava.security.debug=access,failure @@ -31,7 +32,7 @@ import org.apache.commons.logging.LogFactory; */ public class LogSecurityManager extends SecurityManager { - protected static final Log log = LogFactory.getLog(LogSecurityManager.class); + protected static final Logger log = LoggerFactory.getLogger(LogSecurityManager.class); JavaWebStartSecurity sm; public LogSecurityManager(JavaWebStartSecurity sm) { @@ -182,6 +183,7 @@ public class LogSecurityManager extends SecurityManager { } } + @SuppressWarnings("deprecation") @Override public void checkMulticast(InetAddress maddr, byte ttl) { try { @@ -399,6 +401,7 @@ public class LogSecurityManager extends SecurityManager { // protected Class[] getClassContext() { // log.info("getClassContext"); return sm.getClassContext(); // } + @SuppressWarnings("deprecation") @Override public boolean getInCheck() { log.info("getInCheck"); diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java index 08a06570..745042f8 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java @@ -16,8 +16,6 @@ import iaik.x509.extensions.SubjectAltName; import iaik.x509.extensions.SubjectKeyIdentifier; import java.io.IOException; import java.math.BigInteger; -import java.net.InetAddress; -import java.net.UnknownHostException; import java.security.GeneralSecurityException; import java.security.KeyPair; import java.security.KeyPairGenerator; @@ -27,14 +25,15 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class TLSServerCA { public static final int CA_VALIDITY_Y = 3; public static final String MOCCA_TLS_SERVER_ALIAS = "server"; public static final int SERVER_VALIDITY_Y = 3; - private final static Log log = LogFactory.getLog(TLSServerCA.class); + private final static Logger log = LoggerFactory.getLogger(TLSServerCA.class); private KeyPair caKeyPair; private X509Certificate caCert; diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java index 1e35af58..ba2c007d 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/AboutDialog.java @@ -11,7 +11,6 @@ package at.gv.egiz.bku.webstart.gui; -import java.text.Format; import java.text.MessageFormat; import java.util.ResourceBundle; @@ -21,6 +20,11 @@ import java.util.ResourceBundle; */ public class AboutDialog extends javax.swing.JDialog { + /** + * + */ + private static final long serialVersionUID = 1L; + /** Creates new form AboutDialog */ public AboutDialog(java.awt.Frame parent, boolean modal, String version) { super(parent, modal); @@ -33,7 +37,6 @@ public class AboutDialog extends javax.swing.JDialog { * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ - @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { 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 index 55e26313..1f14d751 100644 --- 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 @@ -21,8 +21,9 @@ 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; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * GUI is painted using SwingUtilities.invokeLater, but TrayIcon ActionListener Thread (== webstart thread) joined Jetty Thread @@ -31,7 +32,7 @@ import org.apache.commons.logging.LogFactory; */ public class PINManagementInvoker implements Runnable { - private static final Log log = LogFactory.getLog(PINManagementInvoker.class); + private static final Logger log = LoggerFactory.getLogger(PINManagementInvoker.class); TrayIcon trayIcon; ResourceBundle messages; diff --git a/BKUWebStart/src/main/resources/log4j.properties b/BKUWebStart/src/main/resources/log4j.properties index 76562ccf..81832418 100644 --- a/BKUWebStart/src/main/resources/log4j.properties +++ b/BKUWebStart/src/main/resources/log4j.properties @@ -13,23 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -# loglever DEBUG, appender STDOUT -log4j.rootLogger=DEBUG, file -log4j.logger.org.mortbay.log=INFO -log4j.logger.pki=INFO - -#log4j.additivity.pki=false +# root log level INFO, appender file +log4j.rootLogger=INFO, file -# STDOUT appender -log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender -log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout -#log4j.appender.STDOUT.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n -#log4j.appender.STDOUT.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n -log4j.appender.STDOUT.layout.ConversionPattern=%-5p |%d | %t | %c %x- %m%n +# jetty's log level +log4j.logger.org.mortbay.log=INFO -### FILE appender +# file appender log4j.appender.file=org.apache.log4j.DailyRollingFileAppender log4j.appender.file.datePattern='.'yyyy-MM-dd log4j.appender.file.File=${user.home}/.mocca/logs/webstart.log log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1}:%L - %m%n \ No newline at end of file +log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{2} - %m%n \ No newline at end of file diff --git a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java index 0ea126cb..4f5798d5 100644 --- a/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java +++ b/BKUWebStart/src/test/java/at/gv/egiz/bku/webstart/ConfiguratorTest.java @@ -8,8 +8,6 @@ package at.gv.egiz.bku.webstart; import java.io.File; import java.net.URI; import java.util.zip.ZipOutputStream; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; -- cgit v1.2.3 From 3ab32f61c2cf425aef94dd1974937a6a9bc58e1d Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 30 Sep 2009 16:34:45 +0000 Subject: Deprecate BKUWebStartPackage (pkcs11-signed webstart release zip moved to BKUWebStart) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@516 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 50 ++++++++++++++++++++++++- BKUWebStart/src/main/jnlp/template-local.xml | 4 +- BKUWebStart/src/main/jnlp/template-unstable.xml | 49 ++++++++++++++++++++++++ BKUWebStart/src/main/jnlp/template.xml | 49 ++++++++++++++++++++++++ 4 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 BKUWebStart/src/main/jnlp/template-unstable.xml create mode 100644 BKUWebStart/src/main/jnlp/template.xml (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index f51f1332..b4f910f9 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -122,7 +122,55 @@ - + + + pkcs11-sign + + + + webstart-maven-plugin + org.codehaus.mojo.webstart + + 1.0-beta-1-mocca + + + package + + jnlp-inline + + + + + false + + ${project.basedir}/src/main/jnlp + template-unstable.xml + mocca.jnlp + at.gv.egiz.bku.webstart.Launcher + + + NONE + PKCS11 + iaik.pkcs.pkcs11.provider.IAIKPkcs11 + a-sit + ${pkcs11-pass} + true + + false + false + + + false + false + false + true + true + + + + + + non-webstart diff --git a/BKUWebStart/src/main/jnlp/template-local.xml b/BKUWebStart/src/main/jnlp/template-local.xml index 12ff9d8c..f9a7d917 100644 --- a/BKUWebStart/src/main/jnlp/template-local.xml +++ b/BKUWebStart/src/main/jnlp/template-local.xml @@ -2,10 +2,10 @@ - ${project.Description} + MOCCA Developement E-Government Innovationszentrum (EGIZ) - ${project.Description} (BKU) MOCCA Web Start + ${project.Description} (BKU) MOCCA Web Start - Developement Version ${project.Description} diff --git a/BKUWebStart/src/main/jnlp/template-unstable.xml b/BKUWebStart/src/main/jnlp/template-unstable.xml new file mode 100644 index 00000000..b473f492 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/template-unstable.xml @@ -0,0 +1,49 @@ + + + + + + MOCCA Unstable + E-Government Innovationszentrum (EGIZ) + + ${project.Description} (BKU) MOCCA Web Start - Unstable Build + ${project.Description} + + + + + + + + + + + + + + + + + + + + + + + + + + + $dependencies + + + + + $dependencies + + + + \ No newline at end of file diff --git a/BKUWebStart/src/main/jnlp/template.xml b/BKUWebStart/src/main/jnlp/template.xml new file mode 100644 index 00000000..887e2f10 --- /dev/null +++ b/BKUWebStart/src/main/jnlp/template.xml @@ -0,0 +1,49 @@ + + + + + + ${project.Description} + E-Government Innovationszentrum (EGIZ) + + ${project.Description} (BKU) MOCCA Web Start + ${project.Description} + + + + + + + + + + + + + + + + + + + + + + + + + + + $dependencies + + + + + $dependencies + + + + \ No newline at end of file -- cgit v1.2.3 From 390f6aab59c3fb7a9250d087dc9aec77b6bd865b Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 2 Oct 2009 17:56:27 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.7 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@519 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index b4f910f9..d66f8194 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.7-SNAPSHOT + 1.2.7 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.7-SNAPSHOT + 1.2.7 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung -- cgit v1.2.3 From a47eafbbc567163f0319b066f65eaa7d2d9226c2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 2 Oct 2009 17:56:38 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@521 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index d66f8194..a4132ed9 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.7 + 1.2.8-SNAPSHOT 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.7 + 1.2.8-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung -- cgit v1.2.3 From 9f66f6cc09fd4d010b270d8a83b204728b9336e1 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 19 Oct 2009 09:32:10 +0000 Subject: webstart plugin: default: mocca.jnlp, test-signer local-webstart: mocca-local.jnlp, test-signer (don't use with BKUOnline include-webstart) pkcs11-sign: mocca.jnlp, versign-signer git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@534 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index a4132ed9..117864b5 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -73,16 +73,8 @@ true - - - - - - - local-webstart - - - + + webstart-maven-plugin org.codehaus.mojo.webstart @@ -97,8 +89,8 @@ false ${project.basedir}/src/main/jnlp - template-local.xml - mocca-local.jnlp + template.xml + mocca.jnlp at.gv.egiz.bku.webstart.Launcher @@ -119,6 +111,26 @@ true + + + + + + + + local-webstart + + + + webstart-maven-plugin + org.codehaus.mojo.webstart + + + template-local.xml + mocca-local.jnlp + + + -- cgit v1.2.3 From 04f0881563fdbecd8223627a7752e27690cc99c2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 13 Nov 2009 16:18:32 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.8 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@549 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 117864b5..a61015e4 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.8-SNAPSHOT + 1.2.8 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.8-SNAPSHOT + 1.2.8 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung -- cgit v1.2.3 From 8814f7675055585933d8dae365cf3a95906fac05 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 18 Nov 2009 17:04:48 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@551 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index a61015e4..1c5c3935 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.8 + 1.2.9-SNAPSHOT 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.8 + 1.2.9-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -230,7 +230,7 @@ at.gv.egiz BKUCertificates - 1.0 + 1.1-SNAPSHOT iaik -- cgit v1.2.3 From ceeaeb1790d1ed1ef9565f7c47e8bf247a83f28c Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 2 Dec 2009 09:19:40 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.9 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@558 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 1c5c3935..2eebdc96 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.9-SNAPSHOT + 1.2.9 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.9-SNAPSHOT + 1.2.9 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -230,7 +230,7 @@ at.gv.egiz BKUCertificates - 1.1-SNAPSHOT + 1.1 iaik -- cgit v1.2.3 From f03ce51929e344a92d04aeb4bba473ae47a913b2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 2 Dec 2009 09:23:50 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@560 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 2eebdc96..9592235b 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.9 + 1.2.10-SNAPSHOT 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.9 + 1.2.10-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -230,7 +230,7 @@ at.gv.egiz BKUCertificates - 1.1 + 1.2-SNAPSHOT iaik -- cgit v1.2.3 From dbffe94889d61a98733103b43ed30e53cdefd6ac Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 5 Jan 2010 12:18:12 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.10 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@567 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 9592235b..adc6aa15 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.10-SNAPSHOT + 1.2.10 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.10-SNAPSHOT + 1.2.10 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -230,7 +230,7 @@ at.gv.egiz BKUCertificates - 1.2-SNAPSHOT + 1.2 iaik -- cgit v1.2.3 From 73065b1be0f839c09e8ca481a20f398167404ce4 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 5 Jan 2010 12:21:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@569 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index adc6aa15..bcc40ac5 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.10 + 1.2.11-SNAPSHOT 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.10 + 1.2.11-SNAPSHOT http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung @@ -230,7 +230,7 @@ at.gv.egiz BKUCertificates - 1.2 + 1.3-SNAPSHOT iaik -- cgit v1.2.3 From 678f2d84046c8e3ab7abe459d984868d4c9d2a3c Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 18 Jan 2010 15:55:46 +0000 Subject: support reader configuration (disablePinpad) in BKUWebStart webstart-local -> template-local.xml pkcs11sign -> template.xml default -> template-unstable.xml git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@576 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 4 ++-- .../java/at/gv/egiz/bku/webstart/Configurator.java | 2 +- BKUWebStart/src/main/jnlp/template-unstable.xml | 6 +++--- .../resources/at/gv/egiz/bku/webstart/conf/conf.zip | Bin 3005 -> 3045 bytes 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index bcc40ac5..af7edda8 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -89,7 +89,7 @@ false ${project.basedir}/src/main/jnlp - template.xml + template-unstable.xml mocca.jnlp at.gv.egiz.bku.webstart.Launcher @@ -156,7 +156,7 @@ false ${project.basedir}/src/main/jnlp - template-unstable.xml + template.xml mocca.jnlp at.gv.egiz.bku.webstart.Launcher diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java index d8fe3e70..37638510 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Configurator.java @@ -59,7 +59,7 @@ public class Configurator { * configurations with less than this (major) version will be backuped and updated * allowed: MAJOR[.MINOR[.X[-SNAPSHOT]]] */ - public static final String MIN_CONFIG_VERSION = "1.2.4-SNAPSHOT"; + public static final String MIN_CONFIG_VERSION = "1.2.11-SNAPSHOT"; public static final String CONFIG_DIR = ".mocca/conf/"; public static final String CERTS_DIR = ".mocca/certs/"; public static final String VERSION_FILE = ".version"; diff --git a/BKUWebStart/src/main/jnlp/template-unstable.xml b/BKUWebStart/src/main/jnlp/template-unstable.xml index b473f492..b6574715 100644 --- a/BKUWebStart/src/main/jnlp/template-unstable.xml +++ b/BKUWebStart/src/main/jnlp/template-unstable.xml @@ -3,14 +3,14 @@ | To strip versions from jar filenames do | for JAR in *jar; do mv JAR {JAR/-[0-9]*/.jar}; done |--> - + MOCCA Unstable E-Government Innovationszentrum (EGIZ) - ${project.Description} (BKU) MOCCA Web Start - Unstable Build - ${project.Description} + MOCCA Web Start - Unstable Build + MOCCA Web Start - Unstable Build diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip index 7ed90b7b..3a3eb26d 100644 Binary files a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip and b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/conf/conf.zip differ -- cgit v1.2.3 From 14366682d6361024589c0996aa1c54a4c9c5167c Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 19 Jan 2010 15:17:39 +0000 Subject: DON'T make BKUCertificates a -SNAPSHOT version! git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@584 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index af7edda8..2bd56514 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -230,7 +230,7 @@ at.gv.egiz BKUCertificates - 1.3-SNAPSHOT + 1.2 iaik -- cgit v1.2.3 From 773a478924b43429f9a891a84a42b3d2e67a8d08 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 19 Jan 2010 15:49:22 +0000 Subject: DON'T make BKUCertificates a -SNAPSHOT version! applet log git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@585 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 2bd56514..81b6c395 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -230,7 +230,7 @@ at.gv.egiz BKUCertificates - 1.2 + 1.1 iaik -- cgit v1.2.3 From b2d6b1c93152bf94d25e992815d97d2322941de6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 19 Jan 2010 16:07:11 +0000 Subject: [maven-release-plugin] copy for tag mocca-1.2.11 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/tags/mocca-1.2.11@587 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUWebStart/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUWebStart') diff --git a/BKUWebStart/pom.xml b/BKUWebStart/pom.xml index 81b6c395..02e65f53 100644 --- a/BKUWebStart/pom.xml +++ b/BKUWebStart/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.2.11-SNAPSHOT + 1.2.11 4.0.0 at.gv.egiz BKUWebStart jar BKU Web Start - 1.2.11-SNAPSHOT + 1.2.11 http://mocca.egovlabs.gv.at/ Bürgerkartenumgebung -- cgit v1.2.3