diff options
Diffstat (limited to 'BKUApplet/src')
4 files changed, 31 insertions, 32 deletions
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 32c4feaa..96c0e7eb 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 @@ -42,13 +42,19 @@ import java.net.URL; public class BKUApplet extends JApplet { private static Log log = LogFactory.getLog(BKUApplet.class); + public static final String GUI_STYLE = "GuiStyle"; public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; public final static String LOCALE_PARAM_KEY = "Locale"; public final static String LOGO_URL_KEY = "LogoURL"; public final static String WSDL_URL = "WSDL_URL"; + public static final String HASHDATA_DISPLAY = "HashDataDisplay"; public final static String HASHDATA_URL = "HashDataURL"; public final static String SESSION_ID = "SessionID"; - public static final String BACKGROUND_PARAM = "background"; + public static final String BACKGROUND_PARAM = "Background"; + public static final String REDIRECT_URL = "RedirectURL"; + public static final String REDIRECT_TARGET = "RedirectTarget"; + + public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; protected ResourceBundle resourceBundle; protected BKUWorker worker; @@ -78,7 +84,8 @@ public class BKUApplet extends JApplet { log.warn(ex.getMessage() + ", using default background"); } } - BKUGUIFacade gui = BKUGUIFactory.createGUI(); + String guiStyle = getMyAppletParameter(GUI_STYLE); + BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); gui.init(getContentPane(), localeString, background); worker = new BKUWorker(gui, this, resourceBundle); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index b11413d6..350925ce 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -55,7 +55,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected BKUGUIFacade gui; protected BKUApplet parent; private STALPortType stalPort; - private URL hashDataURL; +// private URL hashDataURL; protected List<String> actionCommandList = new ArrayList<String>(); protected Boolean actionPerformed = false; protected boolean finished = false; @@ -140,7 +140,6 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, gui.showWelcomeDialog(); try { stalPort = getSTALPort(); - hashDataURL = getHashDataURL(); } catch (Exception e) { log.fatal("Failed to call STAL service.", e); actionCommandList.clear(); @@ -155,10 +154,10 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, return; } - //TODO factory for SignRequestHandler providing either WebServiceHDISignRequestHandler or ExternalHDIDisplaySignRequestHandler - AppletContext ctx = parent.getAppletContext(); - log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); - addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); +// //TODO factory for SignRequestHandler providing either WebServiceHDISignRequestHandler or ExternalHDIDisplaySignRequestHandler +// AppletContext ctx = parent.getAppletContext(); +// log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); +// addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); try { String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); @@ -167,6 +166,16 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, sessionId = "TestSession"; } + String hashDataDisplayStyle = parent.getMyAppletParameter(BKUApplet.HASHDATA_DISPLAY); + if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { + log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); + } else { //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) { + URL hashDataURL = getHashDataURL(); + log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(parent.getAppletContext(), hashDataURL)); + } + // log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); // addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); @@ -254,8 +263,8 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected void sendRedirect() { log.info("Done, sending redirect to get BKU response"); - String redirectURL = parent.getMyAppletParameter("redirectURL"); - String redirectTarget = parent.getMyAppletParameter("redirectTarget"); + String redirectURL = parent.getMyAppletParameter(BKUApplet.REDIRECT_URL); + String redirectTarget = parent.getMyAppletParameter(BKUApplet.REDIRECT_TARGET); log.info("Redirecting to: " + redirectURL + " target: " + redirectTarget); URL url = null; if (redirectURL != null) { diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java deleted file mode 100644 index 327ea8aa..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package at.gv.egiz.bku.online.applet; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; - -/** - * - * @author clemens - */ -public class SignRequestHandlerFactory { - - static SignRequestHandler getInstance() { - //TODO return ExternalDisplaySignRequestHandler by default, WebServiceSignRequestHandler if requested - //TODO get configuration as param - return null; - } -} diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 5b10d6b5..b8a0770e 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -20,9 +20,13 @@ <applet code="at.gv.egiz.bku.online.applet.BKUApplet.class" archive="../BKUApplet-1.0-SNAPSHOT.jar, ../test-libs/commons-logging-1.1.1.jar , ../test-libs/iaik_jce_me4se-3.04.jar" width=190 height=130> + <param name="GuiStyle" value="advanced"/> + <param name="Background" value="http://localhost:3495/DemoIntegration/mocca_background.png"/> <param name="WSDL_URL" value="http://localhost:3495/BKUOnline-1.0-SNAPSHOT/stal?wsdl"/> + <param name="HashDataDisplay" value="internal"/> + <!--param name="HashDataURL" value="http://localhost:3495/BKUOnline-1.0-SNAPSHOT/hashDataInput"/--> <param name="SessionId" value="TestSession"/> - <param name="redirectURL" value="http://localhost:3495/BKUOnline-1.0-SNAPSHOT/bkuResult"/> + <param name="RedirectURL" value="http://localhost:3495/BKUOnline-1.0-SNAPSHOT/bkuResult"/> </applet> </center> </body> |