From 5bb4d11327fcfe0fdc4234eeb02f4b09d108109e Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 9 Nov 2009 17:05:57 +0000 Subject: applet version BKUFonts .project git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@536 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 19 ++++++++++++ .../at/gv/egiz/bku/online/applet/BKUApplet.java | 35 ++++++++++++++++----- BKUApplet/src/test/resources/appletTest.html | 5 +-- BKUApplet/src/test/resources/appletviewer.policy | 3 ++ .../at/gv/egiz/bku/gui/SecureViewerDialog.java | 4 +-- .../test/java/at/gv/egiz/bku/gui/BKUGUITest.java | 1 - .../test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java | 6 ++-- .../java/at/gv/egiz/bku/gui/DummyFontLoader.java | 6 ++++ BKUFonts/.classpath | 8 +++++ BKUFonts/.project | 36 ++++++++++++++++++++++ BKUFonts/.settings/org.eclipse.jdt.core.prefs | 7 +++++ .../.settings/org.eclipse.wst.common.component | 6 ++++ .../org.eclipse.wst.common.project.facet.core.xml | 5 +++ BKUFonts/.settings/org.maven.ide.eclipse.prefs | 9 ++++++ bkucommon/pom.xml | 5 --- 15 files changed, 134 insertions(+), 21 deletions(-) create mode 100644 BKUApplet/src/test/resources/appletviewer.policy create mode 100644 BKUFonts/.classpath create mode 100644 BKUFonts/.project create mode 100644 BKUFonts/.settings/org.eclipse.jdt.core.prefs create mode 100644 BKUFonts/.settings/org.eclipse.wst.common.component create mode 100644 BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 BKUFonts/.settings/org.maven.ide.eclipse.prefs diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 4172517b..8f72b7d0 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -44,6 +44,22 @@ + + org.codehaus.mojo + maven-buildnumber-plugin + + + validate + + create + + + + + false + false + + maven-jar-plugin org.apache.maven.plugins @@ -62,6 +78,9 @@ false true + + ${project.version}-r${buildNumber} + test-applet signer ./keystore.ks diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 7a15f7a5..2094e55c 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -22,12 +22,14 @@ import at.gv.egiz.bku.gui.DefaultHelpListener; import at.gv.egiz.bku.gui.AbstractHelpListener; import at.gv.egiz.bku.gui.SwitchFocusListener; import at.gv.egiz.stal.service.translator.STALTranslator; + +import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.jar.Attributes; +import java.util.jar.Manifest; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; import javax.swing.JPanel; @@ -79,14 +81,30 @@ public class BKUApplet extends JApplet { */ protected static final String TEST_SESSION_ID = "TestSession"; + public static final String VERSION; + public static final String UNKNOWN_VERSION = "UNKNOWN"; + static { - if (log.isTraceEnabled()) { - log.trace("enabling webservice communication dump"); - System.setProperty( - "com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", - "true"); + String tmp = UNKNOWN_VERSION; + try { + String BKUAppletJar = BKUApplet.class.getProtectionDomain().getCodeSource().getLocation().toString(); + URL manifestURL = new URL("jar:" + BKUAppletJar + "!/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.debug("BKU Applet " + VERSION); } } + /** * STAL */ @@ -119,13 +137,14 @@ public class BKUApplet extends JApplet { "URL for locating help files, e.g. '../help/' (no help provided if missing)"}}; } + /** * Factory method to create and wire HelpListener, GUI and BKUWorker. * (Config via applet parameters, see BKUApplet.* constants) */ @Override public void init() { - log.info("Welcome to MOCCA"); + log.info("Welcome to MOCCA " + VERSION); log.trace("Called init()"); showStatus("Initializing MOCCA applet"); diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index d1a0f6e2..85834763 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -21,6 +21,7 @@ +

Run applet test with appletviewer -J-Djava.security.policy=appletviewer.policy appletTest.html

@@ -29,10 +30,10 @@ - + - + diff --git a/BKUApplet/src/test/resources/appletviewer.policy b/BKUApplet/src/test/resources/appletviewer.policy new file mode 100644 index 00000000..c26e27b7 --- /dev/null +++ b/BKUApplet/src/test/resources/appletviewer.policy @@ -0,0 +1,3 @@ +grant { + permission java.security.AllPermission; +}; \ No newline at end of file diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java index 1883fce5..c0b14a85 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SecureViewerDialog.java @@ -321,11 +321,11 @@ public class SecureViewerDialog extends JDialog implements ActionListener { public void actionPerformed(ActionEvent e) { if ("close".equals(e.getActionCommand())) { // SecureViewerDialog.dialog.setVisible(false); - log.trace("closing secure viewer"); + log.trace(Thread.currentThread() + " closing secure viewer"); setVisible(false); log.trace("secure viewer closed"); } else if ("save".equals(e.getActionCommand())) { - log.trace("display secure viewer save dialog"); + log.trace(Thread.currentThread() + " display secure viewer save dialog"); showSaveDialog(content, null, null); log.trace("done secure viewer save"); } else { diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java index fdd58850..e2e8d104 100644 --- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java +++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java @@ -32,7 +32,6 @@ import org.junit.Test; * * @author clemens */ -@Ignore public class BKUGUITest { @Test diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java index 5475a45b..20654141 100644 --- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java +++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java @@ -108,9 +108,9 @@ public class BKUGUIWorker implements Runnable { // List signedRefs = new ArrayList(); signedRefs.add(signedRef1); - signedRefs.add(signedRef2); - signedRefs.add(signedRef3); - signedRefs.add(signedRef4); +// signedRefs.add(signedRef2); +// signedRefs.add(signedRef3); +// signedRefs.add(signedRef4); // signedRefs.add(signedRef4); // signedRefs.add(signedRef4); // signedRefs.add(signedRef4); diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java index 87d67adc..505c4247 100644 --- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java +++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java @@ -21,14 +21,20 @@ import at.gv.egiz.bku.gui.viewer.FontProviderException; import at.gv.egiz.bku.gui.viewer.FontProvider; import java.awt.Font; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + /** * * @author Clemens Orthacker */ public class DummyFontLoader implements FontProvider { + protected final static Log log = LogFactory.getLog(DummyFontLoader.class); + @Override public Font getFont() throws FontProviderException { + log.debug("return font"); return new Font("monospaced", Font.PLAIN, 10); } diff --git a/BKUFonts/.classpath b/BKUFonts/.classpath new file mode 100644 index 00000000..d2236dff --- /dev/null +++ b/BKUFonts/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/BKUFonts/.project b/BKUFonts/.project new file mode 100644 index 00000000..484ff825 --- /dev/null +++ b/BKUFonts/.project @@ -0,0 +1,36 @@ + + + BKUFonts + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/BKUFonts/.settings/org.eclipse.jdt.core.prefs b/BKUFonts/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..9db35b19 --- /dev/null +++ b/BKUFonts/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +#Fri Nov 06 15:23:46 CET 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/BKUFonts/.settings/org.eclipse.wst.common.component b/BKUFonts/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..d7d79bb4 --- /dev/null +++ b/BKUFonts/.settings/org.eclipse.wst.common.component @@ -0,0 +1,6 @@ + + + + + + diff --git a/BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml b/BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..f68988cf --- /dev/null +++ b/BKUFonts/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/BKUFonts/.settings/org.maven.ide.eclipse.prefs b/BKUFonts/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 00000000..51d61132 --- /dev/null +++ b/BKUFonts/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Nov 06 15:23:22 CET 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/bkucommon/pom.xml b/bkucommon/pom.xml index e878f155..972136c2 100644 --- a/bkucommon/pom.xml +++ b/bkucommon/pom.xml @@ -25,11 +25,6 @@ ${project.build.directory}/generated-sources/moaspss ${project.build.directory}/generated-sources/moaspss/.staleFlag true
- org.apache.maven.plugins maven-jar-plugin -- cgit v1.2.3