diff options
Diffstat (limited to 'BKUOnline')
7 files changed, 78 insertions, 86 deletions
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml index c82cfc1e..fc5f04fa 100644 --- a/BKUOnline/pom.xml +++ b/BKUOnline/pom.xml @@ -1,4 +1,4 @@ - +<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <artifactId>bku</artifactId> @@ -56,25 +56,20 @@ <version>1.0.5-SNAPSHOT</version> <scope>compile</scope> </dependency> - <!-- build BKUApplet prior to BKUOnline --> - <dependency> - <groupId>at.gv.egiz</groupId> - <artifactId>BKUApplet</artifactId> - <version>1.0.5-SNAPSHOT</version> - <scope>provided</scope> - </dependency> - <dependency> + <dependency> <groupId>at.gv.egiz</groupId> <artifactId>STALService</artifactId> <version>1.0.5-SNAPSHOT</version> </dependency> - <!-- TODO move at.buergerkarte.namespaces.cardchannel.service out from STALXService + <!-- + | TODO move at.buergerkarte.namespaces.cardchannel.service out from STALXService | so that BKUOnline does not have to depend on STALXService + |--> <dependency> <groupId>at.gv.egiz</groupId> <artifactId>STALXService</artifactId> <version>1.0.2-SNAPSHOT</version> - </dependency--> + </dependency> <!-- | see https://wsit.dev.java.net/issues/show_bug.cgi?id=970 --> @@ -102,10 +97,30 @@ <groupId>com.sun.xml.stream</groupId> <version>1.0.1</version> </dependency> + <!-- + | Applet-only dependencies (put in provided scope) + | list to make them known to maven-dependency plugin + | and make sure BKUApplet(Ext) is built prior to BKUOnline + |--> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>BKUApplet</artifactId> + <version>1.0.5-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>BKUAppletExt</artifactId> + <version>1.0.2-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>iaik</groupId> + <artifactId>iaik_jce_me4se</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> - <properties> - <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server> - </properties> <scm> <developerConnection>scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKUOnline</developerConnection> <connection>scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKUOnline</connection> @@ -117,75 +132,31 @@ <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> - <id>copyapplet-dependencies</id> + <id>copy_applet</id> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/${project.build.finalName}/applet</outputDirectory> - <!--<artifactItems> - <artifactItem> - <groupId>at.gv.egiz</groupId> - <artifactId>BKUApplet</artifactId> - <version>1.0</version> - </artifactItem> - <artifactItem> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </artifactItem> - <artifactItem> - <groupId>iaik</groupId> - <artifactId>iaik_jce_me4se</artifactId> - </artifactItem> - </artifactItems>--> - <includeGroupIds>at.gv.egiz</includeGroupIds> - <includeArtifactIds>BKUApplet</includeArtifactIds> - <stripVersion>true</stripVersion> + <includeGroupIds>at.gv.egiz,commons-logging,iaik</includeGroupIds> + <includeArtifactIds>BKUApplet,BKUAppletExt,commons-logging,iaik_jce_me4se</includeArtifactIds> <excludeTransitive>true</excludeTransitive> - </configuration> - </execution> - <execution> - <id>copyapplet</id> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <outputDirectory>${project.build.directory}/${project.build.finalName}/applet</outputDirectory> - <artifactItems> - <artifactItem> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </artifactItem> - <artifactItem> - <groupId>iaik</groupId> - <artifactId>iaik_jce_me4se</artifactId> - </artifactItem> - </artifactItems> + <stripVersion>true</stripVersion> </configuration> </execution> </executions> </plugin> - <!--plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin--> + <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.0.2</version> <configuration> <manifest> - <addDefaultImplementationEntries> - true - </addDefaultImplementationEntries> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> <archive> <manifestEntries> - <Implementation-Build> - ${project.version}-r${buildNumber} - </Implementation-Build> + <Implementation-Build>${project.version}-r${buildNumber}</Implementation-Build> </manifestEntries> </archive> </configuration> @@ -211,7 +182,7 @@ </build> <profiles> <profile> - <id>jaxb-generate</id> + <id>jaxb-generate-stal</id> <build> <plugins> <plugin> @@ -245,4 +216,7 @@ </build> </profile> </profiles> -</project>
\ No newline at end of file + <properties> + <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server> + </properties> +</project> diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java index d9be0981..c758bcee 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java @@ -133,6 +133,9 @@ public class BKURequestHandler extends SpringBKUServlet { .getFormData("appletHashDataDisplay"), charset); String localeFormParam = getStringFromStream(bindingProcessor .getFormData("locale"), charset); + String extension = getStringFromStream(bindingProcessor + .getFormData("appletExtension"), charset); + if (width != null) { try { log.trace("Found applet width parameter: " + width); diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java index a617c61f..81b70b7c 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java +++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java @@ -19,19 +19,17 @@ package at.gv.egiz.stal.service.impl; import at.gv.egiz.stal.ErrorResponse; import at.gv.egiz.stal.HashDataInput; -import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.QuitRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; import at.gv.egiz.stal.service.translator.STALTranslator; import at.gv.egiz.stal.service.translator.TranslationException; -import at.gv.egiz.stal.service.types.InfoboxReadRequestType; import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.types.QuitRequestType; import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; -import at.gv.egiz.stal.service.types.SignRequestType; +import at.gv.egiz.stalx.service.translator.STALXTranslationHandler; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -71,10 +69,12 @@ public class STALRequestBrokerImpl implements STALRequestBroker { if (timeoutMillisec <= 0) timeoutMillisec = DEFAULT_TIMEOUT_MS; timeout = timeoutMillisec; -// translator.registerTranslationHandler(handler); requests = new ArrayList<JAXBElement<? extends RequestType>>(); responses = new ArrayList<JAXBElement<? extends ResponseType>>(); hashDataInputs = new ArrayList<HashDataInput>(); + + // register handler for STAL-X + translator.registerTranslationHandler(new STALXTranslationHandler()); } /** diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java index afeba9cb..a30c6bb2 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java +++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java @@ -18,6 +18,8 @@ package at.gv.egiz.stal.service.impl; //import at.buergerkarte.namespaces.cardchannel.service.CommandAPDUType; //import at.buergerkarte.namespaces.cardchannel.service.ScriptType; +import at.buergerkarte.namespaces.cardchannel.service.CommandAPDUType; +import at.buergerkarte.namespaces.cardchannel.service.ScriptType; import at.gv.egiz.bku.binding.BindingProcessor; import at.gv.egiz.bku.binding.BindingProcessorManager; import at.gv.egiz.bku.binding.Id; @@ -78,8 +80,10 @@ public class STALServiceImpl implements STALPortType { @Resource protected WebServiceContext wsContext; protected IdFactory idF = IdFactory.getInstance(); + /** JAXB ObjectFactories */ private at.gv.egiz.stal.service.types.ObjectFactory stalObjFactory = new at.gv.egiz.stal.service.types.ObjectFactory(); -// private at.buergerkarte.namespaces.cardchannel.service.ObjectFactory ccObjFactory = new at.buergerkarte.namespaces.cardchannel.service.ObjectFactory(); + /** don't confuse with at.buergerkarte.namespaces.cardchannel */ + private at.buergerkarte.namespaces.cardchannel.service.ObjectFactory ccObjFactory = new at.buergerkarte.namespaces.cardchannel.service.ObjectFactory(); @Override public GetNextRequestResponseType connect(String sessId) { @@ -331,12 +335,12 @@ public class STALServiceImpl implements STALPortType { if (responsesIn == null) { log.info("[TestSession] received CONNECT, return dummy requests "); -// ScriptType scriptT = ccObjFactory.createScriptType(); -// CommandAPDUType cmd = ccObjFactory.createCommandAPDUType(); -// cmd.setValue("TestSession CardChannelCMD 1234".getBytes()); -// scriptT.getResetOrCommandAPDUOrVerifyAPDU().add(cmd); -// reqs.add(ccObjFactory.createScript(scriptT)); - addDummyRequests(reqs); +// addDummyRequests(reqs); + ScriptType scriptT = ccObjFactory.createScriptType(); + CommandAPDUType cmd = ccObjFactory.createCommandAPDUType(); + cmd.setValue("TestSession CardChannelCMD 1234".getBytes()); + scriptT.getResetOrCommandAPDUOrVerifyAPDU().add(cmd); + reqs.add(ccObjFactory.createScript(scriptT)); } else if (responsesIn != null && responsesIn.size() > 0 && responsesIn.get(0).getValue() instanceof ErrorResponseType) { log.info("[TestSession] received ErrorResponse, return QUIT request"); QuitRequestType quitT = stalObjFactory.createQuitRequestType(); diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java index 92559254..9caf950f 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java +++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java @@ -47,11 +47,11 @@ public class STALXJAXBContextFactory implements JAXBContextFactory { } List<Class> classes = new ArrayList<Class>(); classes.addAll(classesToBind); -// Class ccOF = at.buergerkarte.namespaces.cardchannel.service.ObjectFactory.class; -// if (!classes.contains(ccOF)) { -// log.debug("adding " + ccOF + " to JAXBContext seed"); -// classes.add(ccOF); -// } + Class ccOF = at.buergerkarte.namespaces.cardchannel.service.ObjectFactory.class; + if (!classes.contains(ccOF)) { + log.debug("adding " + ccOF + " to JAXBContext seed"); + classes.add(ccOF); + } //TODO add typeReference? diff --git a/BKUOnline/src/main/webapp/applet.jsp b/BKUOnline/src/main/webapp/applet.jsp index 3bf0ff40..ada48f22 100644 --- a/BKUOnline/src/main/webapp/applet.jsp +++ b/BKUOnline/src/main/webapp/applet.jsp @@ -39,6 +39,16 @@ String backgroundImg = (String) session.getAttribute("appletBackground"); String guiStyle = (String) session.getAttribute("appletGuiStyle"); String locale = (String) session.getAttribute("locale"); + + String appletClass, appletArchive; + //if (Boolean.parseBoolean((String) session.getAttribute("appletExtension"))) { + if ("activation".equals(guiStyle)) { + appletArchive = "BKUAppletExt.jar"; + appletClass = "at.gv.egiz.bku.online.applet.ext.BKUAppletExt.class"; + } else { + appletArchive = "BKUApplet.jar"; + appletClass = "at.gv.egiz.bku.online.applet.BKUApplet.class"; + } %> <body id="appletpage" style="width:<%=width%>"> <script> @@ -48,8 +58,8 @@ } else { var attributes = { codebase :'applet', - code :'at.gv.egiz.bku.online.applet.BKUApplet.class', - archive :'BKUApplet.jar, commons-logging-1.1.1.jar, iaik_jce_me4se-3.04.jar', + code : '<%=appletClass%>', + archive : '<%=appletArchive + ", commons-logging.jar, iaik_jce_me4se.jar"%>', width : <%=width%>, height :<%=height%> }; diff --git a/BKUOnline/src/main/webapp/slRequestForm.html b/BKUOnline/src/main/webapp/slRequestForm.html index 10330c8c..ff96a6fa 100644 --- a/BKUOnline/src/main/webapp/slRequestForm.html +++ b/BKUOnline/src/main/webapp/slRequestForm.html @@ -95,9 +95,10 @@ legend { name="appletBackground" value="" id="appletBackground"> <p> <label for="appletGuiStyle">GUI Style</label> - <input type="radio" name="appletGuiStyle" value="tiny" checked="checked">tiny + <input type="radio" name="appletGuiStyle" value="tiny">tiny <input type="radio" name="appletGuiStyle" value="simple" checked="checked">simple <input type="radio" name="appletGuiStyle" value="advanced">advanced + <input type="radio" name="appletGuiStyle" value="activation">activation </p> <!-- |