diff options
author | mcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2010-01-26 16:22:56 +0000 |
---|---|---|
committer | mcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2010-01-26 16:22:56 +0000 |
commit | d89f36b67ea1d838a78523538a24e044518f3587 (patch) | |
tree | 6a8f6195d36ffa4971d47616ee674439a7e8a16d /mocca-1.2.11/BKUOnline/src/main/webapp | |
parent | f550e15e55aff5c2cd813e8be90efc9b1120bb13 (diff) | |
download | mocca-d89f36b67ea1d838a78523538a24e044518f3587.tar.gz mocca-d89f36b67ea1d838a78523538a24e044518f3587.tar.bz2 mocca-d89f36b67ea1d838a78523538a24e044518f3587.zip |
MOCCA 1.2.11 with SHA-2 enabled.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/branches/mocca-1.2.11-sha2@599 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'mocca-1.2.11/BKUOnline/src/main/webapp')
22 files changed, 2917 insertions, 0 deletions
diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/META-INF/MANIFEST.MF b/mocca-1.2.11/BKUOnline/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 00000000..ae3f7b68 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Created-By: Apache Maven +Built-By: clemens +Build-Jdk: 1.6.0_10 +Implementation-Build: 1.1.1-SNAPSHOT-r1 diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/META-INF/context.xml b/mocca-1.2.11/BKUOnline/src/main/webapp/META-INF/context.xml new file mode 100644 index 00000000..f38215a1 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/META-INF/context.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<!--Context path="/bkuonline"/--> +<Context path=""/> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/PINManagement.jsp b/mocca-1.2.11/BKUOnline/src/main/webapp/PINManagement.jsp new file mode 100644 index 00000000..e48b8405 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/PINManagement.jsp @@ -0,0 +1,111 @@ +<!-- + 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. +--> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" + import="at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage"%> + +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>MOCCA PIN Management</title> + <link rel="shortcut icon" href="img/chip16.ico" type="image/x-icon"> + <script type="text/javascript" src="js/deployJava.js"></script> + <style type="text/css" media="all">@import "css/applet.css";</style> + + <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> + <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT"> + <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> + </head> + <% + String locale = request.getParameter("locale"); + if (locale == null) { + String acceptLanguage = request.getHeader("Accept-Language"); + locale = AcceptLanguage.getLocale(acceptLanguage).toString(); + } + String widthP = request.getParameter("appletWidth"); + String heightP = request.getParameter("appletHeight"); + int width = (widthP == null) ? 295 + : Integer.parseInt(widthP); + int height = (heightP == null) ? 200 + : Integer.parseInt(heightP); + String guiStyle = request.getParameter("appletGuiStyle"); + if (guiStyle == null) { + guiStyle = "advanced"; + } + String backgroundImg = request.getParameter("appletBackground"); + %> + <body id="appletpage" style="width:<%=width%>" onFocus="focusToApplet()"> + <script> + + // avoid selection of applet before it is completely loaded + var allowSelectionByJS = false; + + if (!deployJava.versionCheck('1.6.0_04+')) { + document + .write('<b>Diese Anwendung benötigt die Java Platform Version 1.6.0_04 oder höher.</b>' + '<input type="submit" value="Java Platform 1.6.0_02 installieren" onclick="deployJava.installLatestJRE();">'); + } else { + var attributes = { + codebase :'applet', + code : 'at.gv.egiz.bku.online.applet.PINManagementApplet.class', + archive : 'BKUAppletExt.jar, commons-logging.jar, iaik_jce_me4se.jar', + width : <%=width%>, + height :<%=height%>, + name : 'moccaapplet', + id : 'moccaapplet' + }; + var parameters = { + GuiStyle : '<%=guiStyle%>', + Locale : '<%=locale%>', + Background : '<%=backgroundImg%>', + HelpURL : '../help/', + SessionID : '<%=request.getSession().getId()%>', + RedirectURL : '../', + RedirectTarget: '_parent', + EnforceRecommendedPINLength: 'true' + }; + var version = '1.6.0_04'; + deployJava.runApplet(attributes, parameters, version); + } + </script> + </body> + + <script> + + function focusToApplet() { + + //alert('try to set focus to applet'); + if (document != null && document.moccaapplet != null && allowSelectionByJS) { + + //alert('set focus to applet.'); + document.moccaapplet.getFocusFromBrowser(); + return true; + } + allowSelectionByJS = true; + } + + function focusToBrowser() { + + // put focus to window + // focus can be assigned to an arbitrary focusable field on the embedding website as well + self.focus(); + + } + + </script> + +</html> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/SLRequestForm.html b/mocca-1.2.11/BKUOnline/src/main/webapp/SLRequestForm.html new file mode 100644 index 00000000..2de652a7 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/SLRequestForm.html @@ -0,0 +1,215 @@ +<!-- + 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. +--> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head> + <title>Security-Layer v1.2 Request Formular</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <link rel="shortcut icon" href="img/chip16.ico" type="image/x-icon"> + <script language="JavaScript" type="text/javascript"> + <!-- + function setAppletDimension(width, height) + { + document.forms.slform.appletWidth.value=width; + document.forms.slform.appletHeight.value=height; + } + function setNOPRequest() { + document.forms.slform.XMLRequest.value='<?xml version="1.0" encoding="UTF-8"?><NullOperationRequest xmlns="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"/>'; + } + + //--> + </script> + <style type="text/css" media="all">@import "css/main.css";</style> + <style type="text/css"> + fieldset { + padding: 1em; + margin: 1em; + font: 80%/ 1 sans-serif; + background-color: #F2EFE9; + padding-left: 5em; + } + + fieldset.submit { + float: none; + width: auto; + border: 0 none #FFF; + padding-left: 14em; + border-style: none; + background-color: transparent; + } + + label { + float: left; + width: 8em; + margin-right: 0.5em; + padding-top: 0.2em; + text-align: right; + font-weight: bold; + color: #000; + padding-top: 0.2em; + } + + legend { + border: 1px solid; + padding: 2px 6px + } + </style> + + </head> + <body> + <h1>Security-Layer v1.2 Request Formular</h1> + <p> + <form action="./http-security-layer-request" method="Post" + enctype="application/x-www-form-urlencoded" name="slform"> + <!--input name="locale" value="es_MX" type="hidden" /--> + <fieldset><legend>Enter XML Request</legend> + <p><label for="XMLRequest">XML Request</label> <textarea + name="XMLRequest" rows=15 cols="60" id="XMLRequest"> +<?xml version="1.0" encoding="UTF-8"?> +<sl:CreateXMLSignatureRequest + xmlns:sl="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"> +<sl:KeyboxIdentifier>SecureSignatureKeypair</sl:KeyboxIdentifier> + <sl:DataObjectInfo Structure="detached"> + <sl:DataObject Reference="test.txt"> + <sl:XMLContent>Ich bin ein einfacher Text.</sl:XMLContent> + </sl:DataObject> + <sl:TransformsInfo> + <sl:FinalDataMetaInfo> + <sl:MimeType>text/plain</sl:MimeType> + </sl:FinalDataMetaInfo> + </sl:TransformsInfo> + </sl:DataObjectInfo> +</sl:CreateXMLSignatureRequest> + </textarea></p> + <!-- +<?xml version="1.0" encoding="UTF-8" ?> +<sl:InfoboxReadRequest + xmlns:sl="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"> + <sl:InfoboxIdentifier>IdentityLink</sl:InfoboxIdentifier> + <sl:BinaryFileParameters ContentIsXMLEntity="true" /> +</sl:InfoboxReadRequest> +--> +<!-- +<?xml version="1.0" encoding="UTF-8"?> +<sl:CreateXMLSignatureRequest + xmlns:sl="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"> + <sl:KeyboxIdentifier>SecureSignatureKeypair</sl:KeyboxIdentifier> + <sl:DataObjectInfo Structure="enveloping"> + <sl:DataObject> + <sl:XMLContent>Ich bin ein einfacher Text. llöäü߀</sl:XMLContent> + </sl:DataObject> + <sl:TransformsInfo> + <sl:FinalDataMetaInfo> + <sl:MimeType>text/plain</sl:MimeType> + </sl:FinalDataMetaInfo> + </sl:TransformsInfo> + </sl:DataObjectInfo> + <sl:DataObjectInfo Structure="enveloping"> + <sl:DataObject> + <sl:XMLContent> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>TestXHTML</title> + <style type="text/css" media="screen"> + .heading { font-size: large; font-weight: bold; } + .content1 { } + .content2 { font-style: italic; } + .content3 { font-family: serif; } + .footer { font-size: small; } + </style> + </head> + <body> + <h3 class="heading">Heading3 large bold llöäü߀</h3> + <p class="content1">Ich bin ein einfacher Text. llöäü߀</p> + <p class="content2">Ich bin ein einfacher Text. llöäü߀</p> + <p class="content3">Ich bin ein einfacher Text. llöäü߀</p> + <p class="footer">Ich bin ein einfacher Text. llöäü߀</p> + </body> +</html> + </sl:XMLContent> + </sl:DataObject> + <sl:TransformsInfo> + <sl:FinalDataMetaInfo> + <sl:MimeType>application/xhtml+xml</sl:MimeType> + </sl:FinalDataMetaInfo> + </sl:TransformsInfo> + </sl:DataObjectInfo> +</sl:CreateXMLSignatureRequest> +--> +<!-- +<?xml version='1.0' encoding='UTF-8'?> +<sl10:InfoboxUpdateRequest xmlns:sl10='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'> + <sl10:InfoboxIdentifier>CardChannel</sl10:InfoboxIdentifier> + <sl10:BinaryFileParameters> + <sl10:XMLContent> + <Script> + <Reset cold='true' /> + <CommandAPDU sequence='1' of='2' expectedSW='9000'>00A4000C023F00</CommandAPDU> + <CommandAPDU sequence='2' of='2' expectedSW='9000'>00B0820000</CommandAPDU> + </Script> + </sl10:XMLContent> + </sl10:BinaryFileParameters> +</sl10:InfoboxUpdateRequest> +--> + </fieldset> + <fieldset><legend>Request Parameters</legend> + <p> + <label for="appletGuiStyle">GUI Style</label> + <input type="radio" name="appletGuiStyle" value="tiny" onclick="setAppletDimension(152, 145)">tiny + <input type="radio" name="appletGuiStyle" value="simple" checked="checked" onclick="setAppletDimension(190,130)">simple + <input type="radio" name="appletGuiStyle" value="advanced" onclick="setAppletDimension(300, 180)">advanced + </p> + + <p><label for="appletWidth">Applet Width</label> <input + name="appletWidth" value="190" id="appletWidth"> + <p><label for="appletHeight">Applet Height</label> <input + name="appletHeight" value="130" id="appletHeight"> + <p><label for="appletBackground">Applet Background</label> <input + name="appletBackground" value="" id="appletBackground"> + <p><label for="appletBackgroundColor">Applet Background Color</label> <input + name="appletBackgroundColor" value="" id="appletBackgroundColor"> + </p> + + <p> + <label for="appletPage">Applet Page</label> + <input type="radio" name="appletPage" value="BKUApplet" checked="checked">Default + <input type="radio" name="appletPage" value="BKUAppletAlternative">Alternative + </p> +<!-- + <p> + <label for="appletExtension">Extension</label> + <input type="radio" name="appletExtension" value="activation" onclick="setInfoboxUpdateRequest()">Activation + <input type="radio" name="appletExtension" value="pin" onclick="setAppletDimension(400, 200)">PIN Management + </p> +--> + +<!-- + <p><label for="RedirectURL">RedirectURL</label> <input + name="RedirectURL" value="" id="RedirectURL"></p> + <p><label for="DataURL">DataURL</label> <input name="DataURL" + value="" id="DataURL"></p> + <p><label for="StylesheetURL">StylesheetURL</label> <input + name="StylesheetURL" value="" id="StylesheetURL"></p> + <p> +--> + + </fieldset> + <fieldset class="submit"><input type="submit" class="submit"/></fieldset> + </form> + + </body> +</html> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml new file mode 100644 index 00000000..fb3cae63 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ 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.
+ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
+
+ <bean id="STALFactory" class="at.gv.egiz.stal.service.impl.RequestBrokerSTALFactory"
+ scope="singleton" />
+
+ <bean id="accessController"
+ class="at.gv.egiz.bku.online.accesscontroller.SpringSecurityManager"
+ scope="singleton" init-method="init">
+ <property name="config" ref="configurator" />
+ </bean>
+
+ <bean id="commandInvoker" class="at.gv.egiz.bku.binding.SLCommandInvokerImpl">
+ <property name="securityManager" ref="accessController" />
+ </bean>
+
+ <bean id="slCommandFactory" class="at.gv.egiz.bku.slcommands.SLCommandFactory"
+ factory-method="getInstance">
+ <property name="concreteFactories">
+ <map>
+ <entry key-ref="nullOperationRequest" value-ref="nullOperationCommandFactory"/>
+ <entry key-ref="infoboxReadRequest" value-ref="infoboxReadCommandFactory"/>
+ <entry key-ref="infoboxUpdateRequest" value-ref="infoboxUpdateCommandFactory"/>
+ <entry key-ref="createXMLSignatureRequest" value-ref="createXMLSignatureCommandFactory"/>
+ <entry key-ref="getStatusRequest" value-ref="getStatusCommandFactory"/>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="nullOperationCommandFactory" class="at.gv.egiz.bku.slcommands.impl.NullOperationCommandFactory"/>
+ <bean id="nullOperationRequest" class="javax.xml.namespace.QName">
+ <constructor-arg value="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"/>
+ <constructor-arg value="NullOperationRequest"/>
+ </bean>
+ <bean id="infoboxReadCommandFactory" class="at.gv.egiz.bku.slcommands.impl.InfoboxReadCommandFactory">
+ <property name="infoboxFactory" ref="infoboxFactory"/>
+ </bean>
+ <bean id="infoboxReadRequest" class="javax.xml.namespace.QName">
+ <constructor-arg value="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"/>
+ <constructor-arg value="InfoboxReadRequest"/>
+ </bean>
+ <bean id="infoboxUpdateCommandFactory" class="at.gv.egiz.bku.slcommands.impl.InfoboxUpdateCommandFactory">
+ <property name="infoboxFactory" ref="infoboxFactory"/>
+ </bean>
+ <bean id="infoboxUpdateRequest" class="javax.xml.namespace.QName">
+ <constructor-arg value="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"/>
+ <constructor-arg value="InfoboxUpdateRequest"/>
+ </bean>
+ <bean id="createXMLSignatureCommandFactory" class="at.gv.egiz.bku.slcommands.impl.CreateXMLSignatureCommandFactory"/>
+ <bean id="createXMLSignatureRequest" class="javax.xml.namespace.QName">
+ <constructor-arg value="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"/>
+ <constructor-arg value="CreateXMLSignatureRequest"/>
+ </bean>
+ <bean id="getStatusCommandFactory" class="at.gv.egiz.bku.slcommands.impl.GetStatusCommandFactory"/>
+ <bean id="getStatusRequest" class="javax.xml.namespace.QName">
+ <constructor-arg value="http://www.buergerkarte.at/namespaces/securitylayer/1.2#"/>
+ <constructor-arg value="GetStatusRequest"/>
+ </bean>
+
+ <bean id="infoboxFactory" class="at.gv.egiz.bku.slcommands.impl.InfoboxFactory">
+ <property name="infoboxFactories">
+ <map>
+ <entry key="Certificates" value-ref="certificatesInfoboxFactory"/>
+ <entry key="IdentityLink" value-ref="identityLinkInfoboxFactory"/>
+ <entry key="CardChannel" value-ref="cardChannelInfoboxFactory"/>
+ <entry key="SV-Personendaten" value-ref="svPersonendatenInfoboxFactory"/>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="certificatesInfoboxFactory" class="at.gv.egiz.bku.slcommands.impl.CertificatesInfoboxFactory"/>
+ <bean id="identityLinkInfoboxFactory" class="at.gv.egiz.bku.slcommands.impl.IdentityLinkInfoboxFactory"/>
+ <bean id="cardChannelInfoboxFactory" class="at.gv.egiz.bku.slcommands.impl.CardChannelInfoboxFactory"/>
+ <bean id="svPersonendatenInfoboxFactory" class="at.gv.egiz.bku.slcommands.impl.SVPersonendatenInfoboxFactory"/>
+
+
+ <bean id="bindingProcessorManager" class="at.gv.egiz.bku.binding.BindingProcessorManagerImpl"
+ scope="singleton">
+ <constructor-arg ref="STALFactory"></constructor-arg>
+ <constructor-arg ref="commandInvoker"></constructor-arg>
+ <constructor-arg ref="configuration"></constructor-arg>
+ </bean>
+
+ <!-- TODO DataURL bean with configuration injected -->
+
+ <bean
+ class="org.springframework.web.context.support.ServletContextAttributeExporter">
+ <property name="attributes">
+ <map>
+ <entry key="bindingProcessorManager">
+ <ref bean="bindingProcessorManager" />
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <!-- Configure Configuration -->
+ <bean id="certValidator" class="at.gv.egiz.bku.conf.CertValidatorImpl"></bean>
+
+
+ <bean id="configurator" class="at.gv.egiz.bku.online.conf.SpringConfigurator"
+ init-method="configure" scope="singleton">
+ <property name="resource"
+ value="classpath:at/gv/egiz/bku/online/conf/defaultConf.properties" />
+ <property name="certValidator" ref="certValidator"></property>
+ </bean>
+
+ <!-- Shutdown Event handler -->
+ <bean id="shutdown" class="at.gv.egiz.bku.online.webapp.ShutdownHandler">
+ <property name="bindingProcessorManager" ref="bindingProcessorManager"></property>
+ </bean>
+
+ <!-- Begin MOCCA Configuration [REFACTORED]
+ | Configuration beans (no conf properties file) should be injected directly
+ | to module configurators (at.gv.egiz.bku.X.conf.Configuration).
+ | Currently, only configuration items are considered.
+ |-->
+ <import resource="mocca-conf.xml"/>
+
+</beans>
\ No newline at end of file diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/mocca-conf.xml b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/mocca-conf.xml new file mode 100644 index 00000000..5c96dc58 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/mocca-conf.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> + +<!-- + | User configuration file. (defaultConf.properties is migrated to this file) +--> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> + + <!-- BKU Common (ie. main) Configuration --> + <bean id="configuration" class="at.gv.egiz.bku.conf.Configuration"> + <property name="maxDataUrlHops" value="50"/> + + <!-- TODO refactor DataURL and inject this bkuCommonConfig to DataURL --> + <!-- TODO inject bkuCommonConfig to SpringBKUServlet and SpringSecurityManager + | and replace SpringConfigurator --> + <!-- used to construct the User-Agent HTTP header + <property name="implementationName" value="MOCCA"/> + <property name="implementationVersion" value="1.0"/--> + </bean> + + <!-- + | ReaderFactory configuration not available in Applet + | + <bean id="smccConfiguration" class="at.gv.egiz.smcc.conf.SMCCConfiguration"> + <property name="disablePinpad" value="true"/> + </bean> + + <bean id="readerFactory" class="at.gv.egiz.smcc.reader.ReaderFactory"> + <property name="configuration" ref="smccConfiguration"/> + </bean> + |--> + +</beans> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/sun-jaxws.xml b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/sun-jaxws.xml new file mode 100644 index 00000000..02d632eb --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/sun-jaxws.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> + +<!-- + Description: tomcat deployement +--> + +<endpoints + xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" + version="2.0"> + + <endpoint + name="STALService" + interface="at.gv.egiz.stal.service.STALPortType" + implementation="at.gv.egiz.stal.service.impl.STALServiceImpl" + wsdl="WEB-INF/wsdl/stal.wsdl" + service="{http://www.egiz.gv.at/wsdl/stal}STALService" + port="{http://www.egiz.gv.at/wsdl/stal}STALPort" + url-pattern="/stal" /> + +</endpoints> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/web.xml b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..41cd400f --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + --> +<web-app id="bkuonline" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> + <display-name>http-security-layer-request</display-name> + + <!-- Begin Spring Config --> + <context-param> + <param-name>contextConfigLocation</param-name> + <param-value>/WEB-INF/applicationContext.xml</param-value> + </context-param> + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> + <!-- End Spring Config --> + + <!-- Begin BKU Config --> + <listener> + <listener-class>at.gv.egiz.bku.online.webapp.SessionTimeout</listener-class> + </listener> + <listener> + <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class> + </listener> + <servlet> + <servlet-name>BKUServlet</servlet-name> + <servlet-class>at.gv.egiz.bku.online.webapp.BKURequestHandler</servlet-class> + </servlet> + <servlet> + <servlet-name>ResultServlet</servlet-name> + <servlet-class>at.gv.egiz.bku.online.webapp.ResultServlet</servlet-class> + <init-param> + <param-name>responseEncoding</param-name> + <param-value>UTF-8</param-value> + </init-param> + <init-param> + <param-name>expiredPage</param-name> + <!-- FIXME --> + <param-value>expired.html</param-value> + </init-param> + </servlet> + <servlet> + <servlet-name>BKUApplet</servlet-name> + <jsp-file>/applet.jsp</jsp-file> + </servlet> + <servlet> + <servlet-name>STALService</servlet-name> + <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>BKUServlet</servlet-name> + <url-pattern>/http-security-layer-request</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>BKUServlet</servlet-name> + <url-pattern>/https-security-layer-request</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>ResultServlet</servlet-name> + <url-pattern>/bkuResult</url-pattern> + </servlet-mapping> + + <!-- + | Configure alternative applet pages that may be requested + | via the 'appletPage' form parameter (cf. SLRequestForm.html) + <servlet> + <servlet-name>BKUAppletAlternative</servlet-name> + <jsp-file>/appletAlternative.jsp</jsp-file> + </servlet--> + + <!-- + | To disable applet caching load the applet via the AppletDispatcher + | (cf. applet.jsp) + <servlet> + <servlet-name>AppletDispatcher</servlet-name> + <servlet-class>at.gv.egiz.bku.online.webapp.AppletDispatcher</servlet-class> + </servlet> + <servlet-mapping> + <servlet-name>AppletDispatcher</servlet-name> + <url-pattern>/applet/dispatch/*</url-pattern> + </servlet-mapping--> + + <!-- End BKU Config --> + + <!-- Begin BKU Web Start Config + | (activate 'include-webstart' profile) + <servlet> + <servlet-name>JnlpDownloadServlet</servlet-name> + <servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class> + <init-param> + <param-name>logLevel</param-name> + <param-value>DEBUG</param-value> + </init-param> + <init-param> + <param-name>logPath</param-name> + <param-value>logs/jnlpdownloadservlet.log</param-value> + </init-param> + </servlet> + + <servlet-mapping> + <servlet-name>JnlpDownloadServlet</servlet-name> + <url-pattern>/webstart/*</url-pattern> + </servlet-mapping> + --> + <!-- End BKU Web Start Config --> + + <servlet-mapping> + <servlet-name>STALService</servlet-name> + <url-pattern>/stal</url-pattern> + </servlet-mapping> + <session-config> + <session-timeout>5</session-timeout> + </session-config> + <welcome-file-list> + <welcome-file>index.html</welcome-file> + <welcome-file>index.jsp</welcome-file> + </welcome-file-list> +</web-app> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl new file mode 100644 index 00000000..dc7ad8f1 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<definitions name="stal" targetNamespace="http://www.egiz.gv.at/wsdl/stal" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://www.egiz.gv.at/wsdl/stal" + xmlns:stal="http://www.egiz.gv.at/stal" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> + <types> + <xsd:schema targetNamespace="http://www.egiz.gv.at/wsdl/stal"> + <xsd:import namespace="http://www.egiz.gv.at/stal" schemaLocation="stal.xsd"/> + <!--xsd:import namespace="http://www.egiz.gv.at/stal" schemaLocation="stal-extended.xsd"/--> + </xsd:schema> + <!-- test + <xsd:schema targetNamespace="http://www.egiz.gv.at/wsdl/stal-extended"> + <xsd:import namespace="http://www.buergerkarte.at/cardchannel" schemaLocation="CardChannel.xsd"/> + </xsd:schema--> + </types> + <message name="ConnectRequest"> + <part name="part1" element="stal:SessionId"/> + </message> + <message name="NextRequestRequest"> + <part name="part1" element="stal:GetNextRequest"/> + </message> + <message name="NextRequestResponse"> + <part name="part1" element="stal:GetNextRequestResponse"/> + </message> + <message name="GetHashDataInputRequest"> + <part name="part1" element="stal:GetHashDataInput"/> + </message> + <message name="GetHashDataInputResponse"> + <part name="part1" element="stal:GetHashDataInputResponse"/> + </message> + <message name="GetHashDataInputFault"> + <part name="part1" element="stal:GetHashDataInputFault"/> + </message> + <portType name="STALPortType"> + <operation name="connect"> + <input name="input3" message="tns:ConnectRequest"/> + <output name="output3" message="tns:NextRequestResponse"/> + </operation> + <operation name="nextRequest"> + <input name="input1" message="tns:NextRequestRequest"/> + <output name="output1" message="tns:NextRequestResponse"/> + </operation> + <operation name="getHashDataInput"> + <input name="input2" message="tns:GetHashDataInputRequest"/> + <output name="output2" message="tns:GetHashDataInputResponse"/> + <fault name="fault1" message="tns:GetHashDataInputFault"/> + </operation> + </portType> + <binding name="STALBinding" type="tns:STALPortType"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="connect"> + <input name="input3"> + <soap:body use="literal"/> + </input> + <output name="output3"> + <soap:body use="literal"/> + </output> + </operation> + <operation name="nextRequest"> + <soap:operation/> + <input name="input1"> + <soap:body use="literal"/> + </input> + <output name="output1"> + <soap:body use="literal"/> + </output> + </operation> + <operation name="getHashDataInput"> + <soap:operation/> + <input name="input2"> + <soap:body use="literal"/> + </input> + <output name="output2"> + <soap:body use="literal"/> + </output> + <fault name="fault1"> + <soap:fault name="fault1"/> + </fault> + </operation> + </binding> + <service name="STALService"> + <port name="STALPort" binding="tns:STALBinding"> + <soap:address location="http://localhost:${HttpDefaultPort}/stal"/> + </port> + </service> +</definitions> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd new file mode 100644 index 00000000..a420035f --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.egiz.gv.at/stal" + xmlns:tns="http://www.egiz.gv.at/stal" + elementFormDefault="qualified"> + <element name="SessionId" type="string"/> + <element name="GetNextRequest" type="tns:GetNextRequestType"/> + <element name="GetNextRequestResponse" type="tns:GetNextRequestResponseType"/> + <element name="GetHashDataInput" type="tns:GetHashDataInputType"/> + <element name="GetHashDataInputResponse" type="tns:GetHashDataInputResponseType"/> + <element name="GetHashDataInputFault" type="tns:GetHashDataInputFaultType"/> + <complexType name="GetNextRequestType"> + <!-- abstract Request/Response type not supported by JAX-WS 2.0 (jdk < 1.6.0_04) + <sequence> + <element name="Response" type="tns:ResponseType" minOccurs="0" maxOccurs="unbounded"/> + </sequence--> + <choice maxOccurs="unbounded"> + <element name="InfoboxReadResponse" type="tns:InfoboxReadResponseType"/> + <element name="SignResponse" type="tns:SignResponseType"/> + <element name="ErrorResponse" type="tns:ErrorResponseType"/> + <element name="StatusResponse" type="tns:StatusResponseType"/> + </choice> + <attribute name="SessionId" type="string"/> + </complexType> + <complexType name="ResponseType" abstract="true" /> + <complexType name="InfoboxReadResponseType"> + <complexContent> + <extension base="tns:ResponseType"> + <sequence> + <element name="InfoboxValue" type="base64Binary"/> + </sequence> + </extension> + </complexContent> + </complexType> + <complexType name="SignResponseType"> + <complexContent> + <extension base="tns:ResponseType"> + <sequence> + <element name="SignatureValue" type="base64Binary"/> + </sequence> + </extension> + </complexContent> + </complexType> + <complexType name="ErrorResponseType"> + <complexContent> + <extension base="tns:ResponseType"> + <sequence> + <element name="ErrorCode" type="int"/> + <element name="ErrorMessage" type="string"/> + </sequence> + </extension> + </complexContent> + </complexType> + <complexType name="StatusResponseType"> + <complexContent> + <extension base="tns:ResponseType"> + <attribute name="cardReady" type="boolean" /> + </extension> + </complexContent> + </complexType> + <complexType name="GetNextRequestResponseType"> + <!-- abstract Request/Response type not supported by JAX-WS 2.0 (jdk < 1.6.0_04) + <sequence> + <element name="Request" type="tns:RequestType" minOccurs="0" maxOccurs="unbounded"/> + </sequence--> + <choice maxOccurs="unbounded"> + <element name="InfoboxReadRequest" type="tns:InfoboxReadRequestType"/> + <element name="SignRequest" type="tns:SignRequestType"/> + <element name="QuitRequest" type="tns:QuitRequestType"/> + <element name="StatusRequest" type="tns:StatusRequestType"/> + </choice> + <attribute name="SessionId" type="string"/> + </complexType> + <complexType name="RequestType" abstract="true"/> + <complexType name="InfoboxReadRequestType"> + <complexContent> + <extension base="tns:RequestType"> + <sequence> + <element name="InfoboxIdentifier"> + <simpleType> + <restriction base="string"> + <enumeration value="Certificates"/> + <enumeration value="IdentityLink"/> + <enumeration value="Mandates"/> + </restriction> + </simpleType> + </element> + <element name="DomainIdentifier" type="anyURI" minOccurs="0"/> + </sequence> + </extension> + </complexContent> + </complexType> + <complexType name="SignRequestType"> + <complexContent> + <extension base="tns:RequestType"> + <sequence> + <element name="KeyIdentifier"> + <simpleType> + <restriction base="string"> + <enumeration value="SecureSignatureKeypair"/> + <enumeration value="CertifiedKeypair"/> + </restriction> + </simpleType> + </element> + <element name="SignedInfo" type="base64Binary"/> + </sequence> + </extension> + </complexContent> + </complexType> + <complexType name="QuitRequestType"> + <complexContent> + <extension base="tns:RequestType"/> + </complexContent> + </complexType> + <complexType name="StatusRequestType"> + <complexContent> + <extension base="tns:RequestType"/> + </complexContent> + </complexType> + <complexType name="GetHashDataInputType"> + <sequence> + <element name="Reference" maxOccurs="unbounded"> + <complexType> + <attribute name="ID" type="string"/> + </complexType> + </element> + </sequence> + <attribute name="SessionId" type="string"/> + </complexType> + <complexType name="GetHashDataInputResponseType"> + <sequence> + <element name="Reference" maxOccurs="unbounded"> + <complexType> + <simpleContent> + <extension base="base64Binary"> + <attribute name="ID" type="string"/> + <attribute name="MimeType" type="string" use="optional"/> + <attribute name="Encoding" type="string" use="optional"/> + <attribute name="Filename" type="string" use="optional"/> + </extension> + </simpleContent> + </complexType> + </element> + </sequence> + <attribute name="SessionId" type="string"/> + </complexType> + <complexType name="GetHashDataInputFaultType"> + <sequence> + <element name="ErrorCode" type="int"/> + <element name="ErrorMessage" type="string"/> + </sequence> + </complexType> +</schema> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/applet.jsp b/mocca-1.2.11/BKUOnline/src/main/webapp/applet.jsp new file mode 100644 index 00000000..582bee7e --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/applet.jsp @@ -0,0 +1,111 @@ +<!-- + 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. +--> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" + import="at.gv.egiz.bku.online.webapp.AppletDispatcher, org.apache.commons.lang.RandomStringUtils, org.apache.commons.lang.StringEscapeUtils" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>MOCCA Applet</title> + <link rel="shortcut icon" href="img/chip16.ico" type="image/x-icon"> + <script type="text/javascript" src="js/deployJava.js"></script> + <style type="text/css" media="all">@import "css/applet.css";</style> + + <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> + <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT"> + <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> + </head> + <% + String locale = StringEscapeUtils.escapeJavaScript( + (String) session.getAttribute("locale")); + + int width = session.getAttribute("appletWidth") == null ? 190 + : (Integer) session.getAttribute("appletWidth"); + int height = session.getAttribute("appletHeight") == null ? 130 + : (Integer) session.getAttribute("appletHeight"); + String backgroundImg = StringEscapeUtils.escapeJavaScript( + session.getAttribute("appletBackground") == null + ? "../img/chip32.png" + : (String) session.getAttribute("appletBackground")); + String backgroundColor = StringEscapeUtils.escapeJavaScript( + (String) session.getAttribute("appletBackgroundColor")); + String guiStyle = StringEscapeUtils.escapeJavaScript( + (String) session.getAttribute("appletGuiStyle")); + + String sessionId = StringEscapeUtils.escapeJavaScript(session.getId()); + + String extension = (String) session.getAttribute("appletExtension"); + String appletClass, appletArchive; + if ("activation".equalsIgnoreCase(extension)) { + appletArchive = "BKUAppletExt"; + appletClass = "at.gv.egiz.bku.online.applet.ActivationApplet.class"; + } else if ("pin".equalsIgnoreCase(extension)) { + appletArchive = "BKUAppletExt"; + appletClass = "at.gv.egiz.bku.online.applet.PINManagementApplet.class"; + } else { + appletArchive = "BKUApplet"; + appletClass = "at.gv.egiz.bku.online.applet.BKUApplet.class"; + } + + // disable applet caching + boolean disableAppletCaching = false; + String codebase = "applet"; + + if (disableAppletCaching) { + // run in AppletDispatcher context and + // append random alphanumeric string to avoid applet caching + // TODO prepend ../ to all xxxURL applet paramaters + codebase += "/" + AppletDispatcher.DISPATCH_CTX; + String rand = AppletDispatcher.RAND_PREFIX + + RandomStringUtils.randomAlphanumeric(16); + appletArchive += rand; + } + + %> + <body id="appletpage" style="width:<%=width%>px"> + <script type="text/javascript"> + if (!deployJava.versionCheck('1.6.0_04+')) { + document.write('<p>Diese Anwendung benötigt Version 6 Update 4 oder höher der <a href="" onclick="deployJava.installLatestJRE();">Java™ Laufzeitumgebung</a>.</p>'); + } else { + var attributes = { + codebase :'<%=codebase%>', + code : '<%=appletClass%>', + archive : '<%=appletArchive +".jar, commons-logging.jar, iaik_jce_me4se.jar"%>', + width : <%=width%>, + height :<%=height%>, + name : 'moccaapplet', + id : 'moccaapplet' + }; + var parameters = { + GuiStyle : '<%=guiStyle%>', + Locale : '<%=locale%>', + Background : '<%=backgroundImg%>', + BackgroundColor : '<%=backgroundColor%>', + WSDL_URL : '../stal;jsessionid=<%=sessionId%>?wsdl', + HelpURL : '../help/', + SessionID : '<%=sessionId%>', + RedirectURL : '../bkuResult', + RedirectTarget: '_parent', + EnforceRecommendedPINLength: 'true' + }; + deployJava.runApplet(attributes, parameters, '1.6.0_04'); + } + </script> + </body> +</html> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/css/applet.css b/mocca-1.2.11/BKUOnline/src/main/webapp/css/applet.css new file mode 100644 index 00000000..d2c734a1 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/css/applet.css @@ -0,0 +1,15 @@ +root { + display: block; +} + +body { + background: #ffffff; + /*background-image: url(../img/mocca-t_s.png);*/ + padding: 0; + margin: 0; + border-style: none; + /* + width:<%=width%> + */ +} + diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/css/appletAlternative.css b/mocca-1.2.11/BKUOnline/src/main/webapp/css/appletAlternative.css new file mode 100644 index 00000000..ce11f1b2 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/css/appletAlternative.css @@ -0,0 +1,12 @@ +root { + display: block; +} + +body { + background: #ffffff; + background-image: url(../img/mocca-t_s.png); + padding: 0; + margin: 0; + border-style: none; +} + diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/css/main.css b/mocca-1.2.11/BKUOnline/src/main/webapp/css/main.css new file mode 100644 index 00000000..b6d6e906 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/css/main.css @@ -0,0 +1,55 @@ +/* +Document : main +Created on : 27.02.2009, 10:24:41 +Author : clemens +Description: +Purpose of the stylesheet follows. +*/ + +/* +TODO customize this sample style +Syntax recommendation http://www.w3.org/TR/REC-CSS2/ +*/ + +root { + display: block; +} + +body { + font-family: sans-serif; + font-size: 14px; +} + +h1 { + font-size: 16px; +} + +.disabled { + /* for IE */ + filter:alpha(opacity=60); + /* CSS3 standard */ + opacity:0.4; +} + +.box { + margin-top: 10px; + color: #292929; + width: 250px; + border: 1px solid #BABABA; + background-color: #ddd; + padding-left: 10px; + padding-right: 10px; + margin-left: 10px; + margin-bottom: 1em; + -o-border-radius: 10px; + -moz-border-radius: 12px; + -webkit-border-radius: 10px; + -webkit-box-shadow: 0px 3px 7px #adadad; + border-radius: 10px; + -moz-box-sizing: border-box; + -opera-sizing: border-box; + -webkit-box-sizing: border-box; + -khtml-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; +}
\ No newline at end of file diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/errorresponse.css b/mocca-1.2.11/BKUOnline/src/main/webapp/errorresponse.css new file mode 100644 index 00000000..41402e71 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/errorresponse.css @@ -0,0 +1,12 @@ +@CHARSET "UTF-8"; +sl\:ErrorResponse {margin: 0.5em; display: block;} +sl\:ErrorCode {display: inline;} +sl\:Info {display: inline;} + +ErrorResponse:lang(de):before {content: "Bei der Verarbeitung der Anfrage durch die Bürgerkartenumgebung ist ein Fehler aufgetreten: "; font-weight: bolder;} +ErrorResponse:before {content: "An error has occoured upon request processing by the citizen card software: "; font-weight: bold;} +ErrorResponse {margin: 0.5em; display: block;} +ErrorCode:lang(de):before {content: "Fehler-Code: ";} +ErrorCode:before {content: "Error Code: ";} +ErrorCode {display: block;} +Info {display: block;}
\ No newline at end of file diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/expired.html b/mocca-1.2.11/BKUOnline/src/main/webapp/expired.html new file mode 100644 index 00000000..2bb961f5 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/expired.html @@ -0,0 +1,29 @@ +<!-- + 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. +--> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Session Expired</title> +</head> +<body> + <p> + Ihre Sitzung ist abgelaufen. + <!--Ein neuer BKU request kann im <a href="HTTP-ohne.html">Requestformular</a> erstellt werden.--> + </p> +</body> +</html>
\ No newline at end of file diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/img/chip16.ico b/mocca-1.2.11/BKUOnline/src/main/webapp/img/chip16.ico Binary files differnew file mode 100644 index 00000000..42175127 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/img/chip16.ico diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/img/chip32.png b/mocca-1.2.11/BKUOnline/src/main/webapp/img/chip32.png Binary files differnew file mode 100644 index 00000000..e7efb020 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/img/chip32.png diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/img/webstart.png b/mocca-1.2.11/BKUOnline/src/main/webapp/img/webstart.png Binary files differnew file mode 100644 index 00000000..87d1cf7b --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/img/webstart.png diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/index.html b/mocca-1.2.11/BKUOnline/src/main/webapp/index.html new file mode 100644 index 00000000..b39dafb7 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/index.html @@ -0,0 +1,59 @@ +<!-- + 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. +--> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head> + <title>MOCCA</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <link rel="shortcut icon" href="img/chip16.ico" type="image/x-icon"> + <link href="css/main.css" rel="stylesheet" type="text/css" /> + <script src="js/deployJava.js" type="text/javascript"></script> + <!--script src="http://java.com/js/deployJava.js" type="text/javascript"></script--> + </head> + <body> + <div id="animDiv" class="box"> + <p> + <h1>MOCCA Online</h1> + <p> + <a href="SLRequestForm.html">Security Layer Request</a> (demo request form) + </p> + <p> + <a href="PINManagement.jsp">PIN Management</a> (pin management applet) + </p> + <p> + <a href="stal">STAL Service</a> (web service endpoint) + </p> + </p> + </div> + + <!-- MOCCA Web Start + | (activate 'include-webstart' profile) + --> + <div id="animDiv" class="box"> + <p> + <h1>MOCCA Web Start</h1> + <p> + <script type="text/javascript"> + var url="webstart/mocca.jnlp" + deployJava.createWebStartLaunchButton(url, "1.6") + </script></p> + <p><a href="webstart/mocca.jnlp">MOCCA JNLP File</a> (requires MIME-type association)</p> + <p><a href="webstart/player.jnlp">Java Cache Viewer</a> (local installation)</p> + </p> + </div> + </body> +</html> diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/js/deployJava.js b/mocca-1.2.11/BKUOnline/src/main/webapp/js/deployJava.js new file mode 100644 index 00000000..e25902c0 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/js/deployJava.js @@ -0,0 +1,925 @@ +/* + * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Sun Microsystems nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Added by EGIZ: + * This file contains workarounds to + * [#423] Firefox 3.0.11 bug #498132 causes applet loading failure + * (lines 95-99) + * [#424] Web Start loading via java plugin (Sun deployment script) fails on WinXP/Vista + * (lines 501-506) + * + * features: + * [#425] Disable WebStart Launch Button for MacOS + * (lines 492-504) + * + */ + +/* + * deployJava.js + * + * This file is part of the Deployment Toolkit. It provides functions for web + * pages to detect the presence of a JRE, install the latest JRE, and easily run + * applets or Web Start programs. Usage guide may be found at http://<TBD>/. + * + * The "live" copy of this file may be found at + * http://java.com/js/deployJava.js. + * You are encouraged to link directly to the live copy of the file. + * + * @version @(#)deployJava.js 1.13 08/10/28 + */ + +var deployJava = { + debug: null, + + myInterval: null, + preInstallJREList: null, + returnPage: null, + brand: null, + locale: null, + installType: null, + + EAInstallEnabled: false, + EarlyAccessURL: null, + + // GetJava page + getJavaURL: 'http://java.sun.com/webapps/getjava/BrowserRedirect?host=java.com', + + // Apple redirect page + appleRedirectPage: 'http://www.apple.com/support/downloads/', + + // mime-type of the DeployToolkit plugin object + mimeType: 'application/npruntime-scriptable-plugin;DeploymentToolkit', + + // location of the Java Web Start launch button graphic + launchButtonPNG: 'img/webstart.png', + + /** + * Returns an array of currently-installed JRE version strings. + * Version strings are of the form #.#[.#[_#]], with the function returning + * as much version information as it can determine, from just family + * versions ("1.4.2", "1.5") through the full version ("1.5.0_06"). + * + * Detection is done on a best-effort basis. Under some circumstances + * only the highest installed JRE version will be detected, and + * JREs older than 1.4.2 will not always be detected. + */ + getJREs: function() { + var list = new Array(); + if (deployJava.isPluginInstalled()) { + var plugin = deployJava.getPlugin(); + //[#423] Firefox 3.0.11 bug #498132 causes applet loading failure + var jvms = plugin.jvms; + for (var i = 0; i < jvms.getLength(); i++) { + list[i] = jvms.get(i).version; + } + } else { + var browser = deployJava.getBrowser(); + + if (browser == 'MSIE') { + if (deployJava.testUsingActiveX('1.8.0')) { + list[0] = '1.8.0'; + } else if (deployJava.testUsingActiveX('1.7.0')) { + list[0] = '1.7.0'; + } else if (deployJava.testUsingActiveX('1.6.0')) { + list[0] = '1.6.0'; + } else if (deployJava.testUsingActiveX('1.5.0')) { + list[0] = '1.5.0'; + } else if (deployJava.testUsingActiveX('1.4.2')) { + list[0] = '1.4.2'; + } else if (deployJava.testForMSVM()) { + list[0] = '1.1'; + } + } + else if (browser == 'Netscape Family') { + if (deployJava.testUsingMimeTypes('1.8')) { + list[0] = '1.8.0'; + } else if (deployJava.testUsingMimeTypes('1.7')) { + list[0] = '1.7.0'; + } else if (deployJava.testUsingMimeTypes('1.6')) { + list[0] = '1.6.0'; + } else if (deployJava.testUsingMimeTypes('1.5')) { + list[0] = '1.5.0'; + } else if (deployJava.testUsingMimeTypes('1.4.2')) { + list[0] = '1.4.2'; + } + } else if (browser == 'Safari') { + if (deployJava.testUsingPluginsArray('1.8.0')) { + list[0] = '1.8.0'; + } else if (deployJava.testUsingPluginsArray('1.7.0')) { + list[0] = '1.7.0'; + } else if (deployJava.testUsingPluginsArray('1.6.0')) { + list[0] = '1.6.0'; + } else if (deployJava.testUsingPluginsArray('1.5.0')) { + list[0] = '1.5.0'; + } else if (deployJava.testUsingPluginsArray('1.4.2')) { + list[0] = '1.4.2'; + } + } + } + + if (deployJava.debug) { + for (var i = 0; i < list.length; ++i) { + alert('We claim to have detected Java SE ' + list[i]); + } + } + + return list; + }, + + /** + * Triggers a JRE installation. The exact effect of triggering an + * installation varies based on platform, browser, and if the + * Deployment Toolkit plugin is installed. + * + * The requestVersion string is of the form #[.#[.#[_#]]][+|*], + * which includes strings such as "1.4", "1.5.0*", and "1.6.0_02+". + * A star (*) means "any version starting within this family" and + * a plus (+) means "any version greater or equal to this". + * "1.5.0*" * matches 1.5.0_06 but not 1.6.0_01, whereas + * "1.5.0+" matches both. + * + * If the Deployment Toolkit plugin is not present, this will just call + * deployJava.installLatestJRE(). + */ + installJRE: function(requestVersion) { + var ret = false; + if (deployJava.isPluginInstalled()) { + if (deployJava.getPlugin().installJRE(requestVersion)) { + deployJava.refresh(); + if (deployJava.returnPage != null) { + document.location = deployJava.returnPage; + } + return true; + } else { + return false; + } + } else { + return deployJava.installLatestJRE(); + } + }, + + + /** + * Triggers a JRE installation. The exact effect of triggering an + * installation varies based on platform, browser, and if the + * Deployment Toolkit plugin is installed. + * + * In the simplest case, the browser window will be redirected to the + * java.com JRE installation page, and (if possible) a redirect back to + * the current URL upon successful installation. The return redirect is + * not always possible, as the JRE installation may require the browser to + * be restarted. + * + * In the best case (when the Deployment Toolkit plugin is present), this + * function will immediately cause a progress dialog to be displayed + * as the JRE is downloaded and installed. + */ + installLatestJRE: function() { + if (deployJava.isPluginInstalled()) { + if (deployJava.getPlugin().installLatestJRE()) { + deployJava.refresh(); + if (deployJava.returnPage != null) { + document.location = deployJava.returnPage; + } + return true; + } else { + return false; + } + } else { + var browser = deployJava.getBrowser(); + var platform = navigator.platform.toLowerCase(); + if ((deployJava.EAInstallEnabled == 'true') && + (platform.indexOf('win') != -1) && + (deployJava.EarlyAccessURL != null)) { + + deployJava.preInstallJREList = deployJava.getJREs(); + if (deployJava.returnPage != null) { + deployJava.myInterval = + setInterval("deployJava.poll()", 3000); + } + + location.href = deployJava.EarlyAccessURL; + + // we have to return false although there may be an install + // in progress now, when complete it may go to return page + return false; + } else { + if (browser == 'MSIE') { + return deployJava.IEInstall(); + } else if ((browser == 'Netscape Family') && + (platform.indexOf('win32') != -1)) { + return deployJava.FFInstall(); + } else { + location.href = deployJava.getJavaURL + + ((deployJava.returnPage != null) ? + ('&returnPage=' + deployJava.returnPage) : '') + + ((deployJava.locale != null) ? + ('&locale=' + deployJava.locale) : '') + + ((deployJava.brand != null) ? + ('&brand=' + deployJava.brand) : ''); + } + // we have to return false although there may be an install + // in progress now, when complete it may go to return page + return false; + } + } + }, + + + /** + * Ensures that an appropriate JRE is installed and then runs an applet. + * minimumVersion is of the form #[.#[.#[_#]]], and is the minimum + * JRE version necessary to run this applet. minimumVersion is optional, + * defaulting to the value "1.1" (which matches any JRE). + * If an equal or greater JRE is detected, runApplet() will call + * writeAppletTag(attributes, parameters) to output the applet tag, + * otherwise it will call installJRE(minimumVersion + '+'). + * + * After installJRE() is called, the script will attempt to detect that the + * JRE installation has completed and begin running the applet, but there + * are circumstances (such as when the JRE installation requires a browser + * restart) when this cannot be fulfilled. + * + * As with writeAppletTag(), this function should only be called prior to + * the web page being completely rendered. Note that version wildcards + * (star (*) and plus (+)) are not supported, and including them in the + * minimumVersion will result in an error message. + */ + runApplet: function(attributes, parameters, minimumVersion) { + if (minimumVersion == 'undefined' || minimumVersion == null) { + minimumVersion = '1.1'; + } + + var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$"; + + var matchData = minimumVersion.match(regex); + + if (deployJava.returnPage == null) { + // if there is an install, come back here and run the applet + deployJava.returnPage = document.location; + } + + if (matchData != null) { + var browser = deployJava.getBrowser(); + if ((browser != '?') && (browser != 'Safari')) { + if (deployJava.versionCheck(minimumVersion + '+')) { + deployJava.writeAppletTag(attributes, parameters); + } else if (deployJava.installJRE(minimumVersion + '+')) { + // after successfull install we need to refresh page to pick + // pick up new plugin + deployJava.refresh(); + location.href = document.location; + deployJava.writeAppletTag(attributes, parameters); + } + } else { + // for unknown or Safari - just try to show applet + deployJava.writeAppletTag(attributes, parameters); + } + } else { + if (deployJava.debug) { + alert('Invalid minimumVersion argument to runApplet():' + + minimumVersion); + } + } + }, + + + /** + * Outputs an applet tag with the specified attributes and parameters, where + * both attributes and parameters are associative arrays. Each key/value + * pair in attributes becomes an attribute of the applet tag itself, while + * key/value pairs in parameters become <PARAM> tags. No version checking + * or other special behaviors are performed; the tag is simply written to + * the page using document.writeln(). + * + * As document.writeln() is generally only safe to use while the page is + * being rendered, you should never call this function after the page + * has been completed. + */ + writeAppletTag: function(attributes, parameters) { + var s = '<' + 'applet '; + for (var attribute in attributes) { + s += (' ' + attribute + '="' + attributes[attribute] + '"'); + } + s += '>'; + document.write(s); + + if (parameters != 'undefined' && parameters != null) { + var codebaseParam = false; + for (var parameter in parameters) { + if (parameter == 'codebase_lookup') { + codebaseParam = true; + } + s = '<param name="' + parameter + '" value="' + + parameters[parameter] + '">'; + document.write(s); + } + if (!codebaseParam) { + document.write('<param name="codebase_lookup" value="false">'); + } + } + document.write('<' + '/' + 'applet' + '>'); + }, + + + /** + * Returns true if there is a matching JRE version currently installed + * (among those detected by getJREs()). The versionPattern string is + * of the form #[.#[.#[_#]]][+|*], which includes strings such as "1.4", + * "1.5.0*", and "1.6.0_02+". + * A star (*) means "any version within this family" and a plus (+) means + * "any version greater or equal to the specified version". "1.5.0*" + * matches 1.5.0_06 but not 1.6.0_01, whereas "1.5.0+" matches both. + * + * If the versionPattern does not include all four version components + * but does not end with a star or plus, it will be treated as if it + * ended with a star. "1.5" is exactly equivalent to "1.5*", and will + * match any version number beginning with "1.5". + * + * If getJREs() is unable to detect the precise version number, a match + * could be ambiguous. For example if getJREs() detects "1.5", there is + * no way to know whether the JRE matches "1.5.0_06+". versionCheck() + * compares only as much of the version information as could be detected, + * so versionCheck("1.5.0_06+") would return true in in this case. + * + * Invalid versionPattern will result in a JavaScript error alert. + * versionPatterns which are valid but do not match any existing JRE + * release (e.g. "32.65+") will always return false. + */ + versionCheck: function(versionPattern) + { + var index = 0; + var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?(\\*|\\+)?$"; + + var matchData = versionPattern.match(regex); + + if (matchData != null) { + var familyMatch = true; + + var patternArray = new Array(); + + for (var i = 1; i < matchData.length; ++i) { + // browser dependency here. + // Fx sets 'undefined', IE sets '' string for unmatched groups + if ((typeof matchData[i] == 'string') && (matchData[i] != '')) { + patternArray[index] = matchData[i]; + index++; + } + } + + if (patternArray[patternArray.length-1] == '+') { + familyMatch = false; + patternArray.length--; + } else { + if (patternArray[patternArray.length-1] == '*') { + patternArray.length--; + } + } + + var list = deployJava.getJREs(); + for (var i = 0; i < list.length; ++i) { + if (deployJava.compareVersionToPattern(list[i], patternArray, + familyMatch)) { + return true; + } + } + + return false; + } else { + alert('Invalid versionPattern passed to versionCheck: ' + + versionPattern); + return false; + } + }, + + + /** + * Returns true if an installation of Java Web Start of the specified + * minimumVersion can be detected. minimumVersion is optional, and + * if not specified, '1.4.2' will be used. + * (Versions earlier than 1.4.2 may not be detected.) + */ + isWebStartInstalled: function(minimumVersion) { + + var browser = deployJava.getBrowser(); + if ((browser == '?') || (browser == 'Safari')) { + // we really don't know - better to try to use it than reinstall + return true; + } + + if (minimumVersion == 'undefined' || minimumVersion == null) { + minimumVersion = '1.4.2'; + } + + var retval = false; + var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$"; + var matchData = minimumVersion.match(regex); + + if (matchData != null) { + retval = deployJava.versionCheck(minimumVersion + '+'); + } else { + if (deployJava.debug) { + alert('Invalid minimumVersion argument to isWebStartInstalled(): ' + minimumVersion); + } + retval = deployJava.versionCheck('1.4.2+'); + } + return retval; + }, + + + /** + * Outputs a launch button for the specified JNLP URL. When clicked, the + * button will ensure that an appropriate JRE is installed and then launch + * the JNLP application. minimumVersion is of the form #[.#[.#[_#]]], and + * is the minimum JRE version necessary to run this JNLP application. + * minimumVersion is optional, and if it is not specified, '1.4.2' + * will be used. + * If an appropriate JRE or Web Start installation is detected, + * the JNLP application will be launched, otherwise installLatestJRE() + * will be called. + * + * After installLatestJRE() is called, the script will attempt to detect + * that the JRE installation has completed and launch the JNLP application, + * but there are circumstances (such as when the JRE installation + * requires a browser restart) when this cannot be fulfilled. + */ + createWebStartLaunchButton: function(jnlp, minimumVersion) { + + if (deployJava.returnPage == null) { + // if there is an install, come back and run the jnlp file + deployJava.returnPage = jnlp; + } + + var url = 'javascript:' + + 'if (!deployJava.isWebStartInstalled("' + + minimumVersion + '")) {' + + 'if (deployJava.installLatestJRE()) {' + + 'if (deployJava.launch("' + jnlp + '")) {}' + + '}' + + '} else {' + + 'if (deployJava.launch("' + jnlp + '")) {}' + + '}'; + + // [#425] Disable WebStart Launch Button for MacOS + if (navigator.appVersion.toLowerCase().indexOf("mac")!=-1 && + navigator.userAgent.toLowerCase().indexOf("os x 10_6")==-1 && + navigator.userAgent.toLowerCase().indexOf("os x 10.6")==-1 ) + { + document.write('<' + 'a disabled="disabled"' + + ' onMouseOver="window.status=\'\'; ' + + 'return true;"><' + 'img class="disabled"' + + 'src="' + deployJava.launchButtonPNG + '" ' + + 'border="0" /><' + '/' + 'a' + '>'); + } else { + document.write('<' + 'a href="' + url + + '" onMouseOver="window.status=\'\'; ' + + 'return true;"><' + 'img ' + + 'src="' + deployJava.launchButtonPNG + '" ' + + 'border="0" /><' + '/' + 'a' + '>'); + } + }, + + + /** + * Launch a JNLP application, (using the plugin if available) + */ + launch: function(jnlp) { + //[#424] Web Start loading via java plugin (Sun deployment script) fails on WinXP +// if (deployJava.isPluginInstalled()) { +// return deployJava.getPlugin().launch(jnlp); +// } else { + document.location=jnlp; + return true; +// } + }, + + + /* + * returns true if the ActiveX or XPI plugin is installed + */ + isPluginInstalled: function() { + var plugin = deployJava.getPlugin(); + if (plugin && plugin.jvms) { + return true; + } else { + return false; + } + }, + + /* + * returns true if the plugin is installed and AutoUpdate is enabled + */ + isAutoUpdateEnabled: function() { + if (deployJava.isPluginInstalled()) { + return deployJava.getPlugin().isAutoUpdateEnabled(); + } + return false; + }, + + /* + * sets AutoUpdate on if plugin is installed + */ + setAutoUpdateEnabled: function() { + if (deployJava.isPluginInstalled()) { + return deployJava.getPlugin().setAutoUpdateEnabled(); + } + return false; + }, + + /* + * sets the preferred install type : null, online, kernel + */ + setInstallerType: function(type) { + deployJava.installType = type; + if (deployJava.isPluginInstalled()) { + return deployJava.getPlugin().setInstallerType(type); + } + return false; + }, + + /* + * sets additional package list - to be used by kernel installer + */ + setAdditionalPackages: function(packageList) { + if (deployJava.isPluginInstalled()) { + return deployJava.getPlugin().setAdditionalPackages( + packageList); + } + return false; + }, + + /* + * sets preference to install Early Access versions if available + */ + setEarlyAccess: function(enabled) { + deployJava.EAInstallEnabled = enabled; + }, + + /* + * Determines if the next generation plugin (Plugin II) is default + */ + isPlugin2: function() { + if (deployJava.isPluginInstalled()) { + try { + return deployJava.getPlugin().isPlugin2(); + } catch (err) { + // older plugin w/o isPlugin2() function - just fall through + } + } + return false; + }, + + + getPlugin: function() { + deployJava.refresh(); + var ret = document.getElementById('deployJavaPlugin'); + return ret; + }, + + compareVersionToPattern: function(version, patternArray, familyMatch) { + var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$"; + var matchData = version.match(regex); + + if (matchData != null) { + var index = 0; + var result = new Array(); + + for (var i = 1; i < matchData.length; ++i) { + if ((typeof matchData[i] == 'string') && (matchData[i] != '')) + { + result[index] = matchData[i]; + index++; + } + } + + var l = Math.min(result.length, patternArray.length); + + if (familyMatch) { + for (var i = 0; i < l; ++i) { + if (result[i] != patternArray[i]) return false; + } + + return true; + } else { + for (var i = 0; i < l; ++i) { + if (result[i] < patternArray[i]) { + return false; + } else if (result[i] > patternArray[i]) { + return true; + } + } + + return true; + } + } else { + return false; + } + }, + + + getBrowser: function() { + var browser = navigator.userAgent.toLowerCase(); + + if (deployJava.debug) { + alert('userAgent -> ' + browser); + } + + if ((navigator.vendor) && + (navigator.vendor.toLowerCase().indexOf('apple') != -1) && + (browser.indexOf('safari') != -1)) { + if (deployJava.debug) { + alert('We claim to have detected "Safari".'); + } + return 'Safari'; + } else if (browser.indexOf('msie') != -1) { + if (deployJava.debug) { + alert('We claim to have detected "IE".'); + } + return 'MSIE'; +// } else if ((browser.indexOf('konqueror') != -1)) { +// if (deployJava.debug) { +// alert('We claim to have detected "Konqueror".'); +// } + } else if ((browser.indexOf('mozilla') != -1) || + (browser.indexOf('firefox') != -1)) { + if (deployJava.debug) { + alert('We claim to have detected a Netscape family browser.'); + } + return 'Netscape Family'; + } else { + if (deployJava.debug) { + alert('We claim to have failed to detect a browser.'); + } + return '?'; + } + }, + + + testUsingActiveX: function(version) { + var objectName = 'JavaWebStart.isInstalled.' + version + '.0'; + + if (!ActiveXObject) { + if (deployJava.debug) { + alert ('Browser claims to be IE, but no ActiveXObject object?'); + } + return false; + } + + try { + return (new ActiveXObject(objectName) != null); + } catch (exception) { + return false; + } + }, + + + testForMSVM: function() { + var clsid = '{08B0E5C0-4FCB-11CF-AAA5-00401C608500}'; + + if (typeof oClientCaps != 'undefined') { + var v = oClientCaps.getComponentVersion(clsid, "ComponentID"); + if ((v == '') || (v == '5,0,5000,0')) { + return false; + } else { + return true; + } + } else { + return false; + } + }, + + + testUsingMimeTypes: function(version) { + if (!navigator.mimeTypes) { + if (deployJava.debug) { + alert ('Browser claims to be Netscape family, but no mimeTypes[] array?'); + } + return false; + } + + for (var i = 0; i < navigator.mimeTypes.length; ++i) { + s = navigator.mimeTypes[i].type; + var m = s.match(/^application\/x-java-applet\x3Bversion=(1\.8|1\.7|1\.6|1\.5|1\.4\.2)$/); + if (m != null) { + if (deployJava.compareVersions(m[1], version)) { + return true; + } + } + } + return false; + }, + + + testUsingPluginsArray: function(version) { + if ((!navigator.plugins) || (!navigator.plugins.length)) { + if (deployJava.debug) { + alert ('Browser claims to be Safari, but no plugins[] array?'); + } + return false; + } + + for (var i = 0; i < navigator.plugins.length; ++i) { + s = navigator.plugins[i].description; + + if (s.search(/^Java Switchable Plug-in/) != -1) { + return true; + } + + m = s.match(/^Java (1\.4\.2|1\.5|1\.6|1\.7).* Plug-in/); + if (m != null) { + if (deployJava.compareVersions(m[1], version)) return true; + } + } + return false; + }, + + IEInstall: function() { + + location.href = deployJava.getJavaURL + + ((deployJava.returnPage != null) ? + ('&returnPage=' + deployJava.returnPage) : '') + + ((deployJava.locale != null) ? + ('&locale=' + deployJava.locale) : '') + + ((deployJava.brand != null) ? ('&brand=' + deployJava.brand) : '') + + ((deployJava.installType != null) ? + ('&type=' + deployJava.installType) : ''); + + // should not actually get here + return false; + }, + + done: function (name, result) { + }, + + FFInstall: function() { + + location.href = deployJava.getJavaURL + + ((deployJava.returnPage != null) ? + ('&returnPage=' + deployJava.returnPage) : '') + + ((deployJava.locale != null) ? + ('&locale=' + deployJava.locale) : '') + + ((deployJava.brand != null) ? ('&brand=' + deployJava.brand) : '') + + ((deployJava.installType != null) ? + ('&type=' + deployJava.installType) : ''); + + // should not actually get here + return false; + }, + + // return true if 'installed' (considered as a JRE version string) is + // greater than or equal to 'required' (again, a JRE version string). + compareVersions: function(installed, required) { + + var a = installed.split('.'); + var b = required.split('.'); + + for (var i = 0; i < a.length; ++i) { + a[i] = Number(a[i]); + } + for (var i = 0; i < b.length; ++i) { + b[i] = Number(b[i]); + } + if (a.length == 2) { + a[2] = 0; + } + + if (a[0] > b[0]) return true; + if (a[0] < b[0]) return false; + + if (a[1] > b[1]) return true; + if (a[1] < b[1]) return false; + + if (a[2] > b[2]) return true; + if (a[2] < b[2]) return false; + + return true; + }, + + + enableAlerts: function() { + deployJava.debug = true; + }, + + poll: function() { + + deployJava.refresh(); + var postInstallJREList = deployJava.getJREs(); + + if ((deployJava.preInstallJREList.length == 0) && + (postInstallJREList.length != 0)) { + clearInterval(deployJava.myInterval); + if (deployJava.returnPage != null) { + location.href = deployJava.returnPage; + }; + } + + if ((deployJava.preInstallJREList.length != 0) && + (postInstallJREList.length != 0) && + (deployJava.preInstallJREList[0] != postInstallJREList[0])) { + clearInterval(deployJava.myInterval); + if (deployJava.returnPage != null) { + location.href = deployJava.returnPage; + } + } + + }, + + writePluginTag: function() { + var browser = deployJava.getBrowser(); + if (browser == 'MSIE') { + document.write('<' + + 'object classid="clsid:CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA" ' + + 'id="deployJavaPlugin" width="0" height="0">' + + '<' + '/' + 'object' + '>'); + } else if (browser == 'Netscape Family') { + if (navigator.mimeTypes != null) for (var i=0; + i < navigator.mimeTypes.length; i++) { + if (navigator.mimeTypes[i].type == deployJava.mimeType) { + if (navigator.mimeTypes[i].enabledPlugin) { + document.write('<' + + 'embed id="deployJavaPlugin" type="' + + deployJava.mimeType + '" hidden="true" />'); + } + } + } + } + }, + + refresh: function() { + navigator.plugins.refresh(false); + + var browser = deployJava.getBrowser(); + if (browser == 'Netscape Family') { + var plugin = document.getElementById('deployJavaPlugin'); + // only do this again if no plugin + if (plugin == null) { + if (navigator.mimeTypes != null) for (var i=0; + i < navigator.mimeTypes.length; i++) { + if (navigator.mimeTypes[i].type == deployJava.mimeType) { + if (navigator.mimeTypes[i].enabledPlugin) { + document.write('<' + + 'embed id="deployJavaPlugin" type="' + + deployJava.mimeType + '" hidden="true" />'); + } + } + } + } + } + }, + + do_initialize: function() { + deployJava.writePluginTag(); + if (deployJava.locale == null) { + var loc = null; + + if (loc == null) try { + loc = navigator.userLanguage; + } catch (err) { } + + if (loc == null) try { + loc = navigator.systemLanguage; + } catch (err) { } + + if (loc == null) try { + loc = navigator.language; + } catch (err) { } + + if (loc != null) { + loc.replace("-","_") + deployJava.locale = loc; + } + } + } + +}; +deployJava.do_initialize(); + diff --git a/mocca-1.2.11/BKUOnline/src/main/webapp/js/deployJava_orig.js b/mocca-1.2.11/BKUOnline/src/main/webapp/js/deployJava_orig.js new file mode 100644 index 00000000..316fa278 --- /dev/null +++ b/mocca-1.2.11/BKUOnline/src/main/webapp/js/deployJava_orig.js @@ -0,0 +1,725 @@ +/* + * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Sun Microsystems nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Added by EGIZ: + * This file contains workarounds to + * [#423] Firefox 3.0.11 bug #498132 causes applet loading failure + * (lines 95-99) + * [#424] Web Start loading via java plugin (Sun deployment script) fails on WinXP/Vista + * (lines 501-506) + * + * features: + * [#425] Disable WebStart Launch Button for MacOS + * (lines 492-504) + * + */ + +/* + * deployJava.js + * + * This file is part of the Deployment Toolkit. It provides functions for web + * pages to detect the presence of a JRE, install the latest JRE, and easily run + * applets or Web Start programs. Usage guide may be found at http://<TBD>/. + * + * The "live" copy of this file may be found at + * http://java.com/js/deployJava.js. + * You are encouraged to link directly to the live copy of the file. + * + * @version @(#)deployJava.js XXXXX + */ + +var deployJava={ + debug:null, + + myInterval:null, + preInstallJREList:null, + returnPage:null, + brand:null, + locale:null, + installType:null, + + EAInstallEnabled:false, + EarlyAccessURL:null, + + // GetJava page + getJavaURL:'http://java.sun.com/webapps/getjava/BrowserRedirect?host=java.com', + + // Apple redirect page + appleRedirectPage:'http://www.apple.com/support/downloads/', + oldMimeType:'application/npruntime-scriptable-plugin;DeploymentToolkit', + mimeType:'application/java-deployment-toolkit', + launchButtonPNG:'http://java.sun.com/products/jfc/tsc/articles/swing2d/webstart.png', + + getJREs:function(){ + var list=new Array(); + if(deployJava.isPluginInstalled()){ + var plugin=deployJava.getPlugin(); + var VMs=plugin.jvms; + for(var i=0;i<VMs.getLength();i++){ + list[i]=VMs.get(i).version; + } + }else{ + var browser=deployJava.getBrowser(); + + if(browser=='MSIE'){ + if(deployJava.testUsingActiveX('1.8.0')){ + list[0]='1.8.0'; + }else if(deployJava.testUsingActiveX('1.7.0')){ + list[0]='1.7.0'; + }else if(deployJava.testUsingActiveX('1.6.0')){ + list[0]='1.6.0'; + }else if(deployJava.testUsingActiveX('1.5.0')){ + list[0]='1.5.0'; + }else if(deployJava.testUsingActiveX('1.4.2')){ + list[0]='1.4.2'; + }else if(deployJava.testForMSVM()){ + list[0]='1.1'; + } + } + else if(browser=='Netscape Family'){ + if(deployJava.testUsingMimeTypes('1.8')){ + list[0]='1.8.0'; + }else if(deployJava.testUsingMimeTypes('1.7')){ + list[0]='1.7.0'; + }else if(deployJava.testUsingMimeTypes('1.6')){ + list[0]='1.6.0'; + }else if(deployJava.testUsingMimeTypes('1.5')){ + list[0]='1.5.0'; + }else if(deployJava.testUsingMimeTypes('1.4.2')){ + list[0]='1.4.2'; + } + }else if(browser=='Safari'){ + if(deployJava.testUsingPluginsArray('1.8.0')){ + list[0]='1.8.0'; + }else if(deployJava.testUsingPluginsArray('1.7.0')){ + list[0]='1.7.0'; + }else if(deployJava.testUsingPluginsArray('1.6.0')){ + list[0]='1.6.0'; + }else if(deployJava.testUsingPluginsArray('1.5.0')){ + list[0]='1.5.0'; + }else if(deployJava.testUsingPluginsArray('1.4.2')){ + list[0]='1.4.2'; + } + } + } + + if(deployJava.debug){ + for(var i=0;i<list.length;++i){ + alert('We claim to have detected Java SE '+list[i]); + } + } + + return list; + }, + + installJRE:function(requestVersion){ + var ret=false; + if(deployJava.isPluginInstalled()){ + if(deployJava.getPlugin().installJRE(requestVersion)){ + deployJava.refresh(); + if(deployJava.returnPage!=null){ + document.location=deployJava.returnPage; + } + return true; + }else{ + return false; + } + }else{ + return deployJava.installLatestJRE(); + } + }, + + installLatestJRE:function(){ + if(deployJava.isPluginInstalled()){ + if(deployJava.getPlugin().installLatestJRE()){ + deployJava.refresh(); + if(deployJava.returnPage!=null){ + document.location=deployJava.returnPage; + } + return true; + }else{ + return false; + } + }else{ + var browser=deployJava.getBrowser(); + var platform=navigator.platform.toLowerCase(); + if((deployJava.EAInstallEnabled=='true') && + (platform.indexOf('win')!=-1) && + (deployJava.EarlyAccessURL!=null)) { + + deployJava.preInstallJREList=deployJava.getJREs(); + if(deployJava.returnPage!=null){ + deployJava.myInterval= + setInterval("deployJava.poll()",3000); + } + + location.href=deployJava.EarlyAccessURL; + return false; + }else{ + if(browser=='MSIE'){ + return deployJava.IEInstall(); + }else if((browser=='Netscape Family')&& + (platform.indexOf('win32')!=-1)){ + return deployJava.FFInstall(); + }else{ + location.href=deployJava.getJavaURL+ + ((deployJava.returnPage!=null)? + ('&returnPage='+deployJava.returnPage):'')+ + ((deployJava.locale!=null)? + ('&locale='+deployJava.locale):'')+ + ((deployJava.brand!=null)? + ('&brand='+deployJava.brand):''); + } + return false; + } + } + }, + + runApplet:function(attributes,parameters,minimumVersion){ + if(minimumVersion=='undefined'||minimumVersion==null){ + minimumVersion='1.1'; + } + + var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$"; + + var matchData=minimumVersion.match(regex); + + if(deployJava.returnPage==null){ + deployJava.returnPage=document.location; + } + + if(matchData!=null){ + var browser=deployJava.getBrowser(); + if((browser!='?')&&(browser!='Safari')){ + if(deployJava.versionCheck(minimumVersion+'+')){ + deployJava.writeAppletTag(attributes,parameters); + }else if(deployJava.installJRE(minimumVersion+'+')){ + deployJava.refresh(); + location.href=document.location; + deployJava.writeAppletTag(attributes,parameters); + } + }else{ + deployJava.writeAppletTag(attributes,parameters); + } + }else{ + if(deployJava.debug){ + alert('Invalid minimumVersion argument to runApplet():'+ + minimumVersion); + } + } + }, + + writeAppletTag:function(attributes,parameters){ + var s='<'+'applet '; + for(var attribute in attributes){ + s+=(' '+attribute+'="'+attributes[attribute]+'"'); + } + s+='>'; + document.write(s); + + if(parameters!='undefined'&¶meters!=null){ + var codebaseParam=false; + for(var parameter in parameters){ + if(parameter=='codebase_lookup'){ + codebaseParam=true; + } + s='<param name="'+parameter+'" value="'+ + parameters[parameter]+'">'; + document.write(s); + } + if(!codebaseParam){ + document.write('<param name="codebase_lookup" value="false">'); + } + } + document.write('<'+'/'+'applet'+'>'); + }, + + versionCheck:function(versionPattern) + + { + var index=0; + var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?(\\*|\\+)?$"; + + var matchData=versionPattern.match(regex); + + if(matchData!=null){ + var familyMatch=true; + + var patternArray=new Array(); + + for(var i=1;i<matchData.length;++i){ + if((typeof matchData[i]=='string')&&(matchData[i]!='')){ + patternArray[index]=matchData[i]; + index++; + } + } + + if(patternArray[patternArray.length-1]=='+'){ + familyMatch=false; + patternArray.length--; + }else{ + if(patternArray[patternArray.length-1]=='*'){ + patternArray.length--; + } + } + + var list=deployJava.getJREs(); + for(var i=0;i<list.length;++i){ + if(deployJava.compareVersionToPattern(list[i],patternArray, + familyMatch)){ + return true; + } + } + + return false; + }else{ + alert('Invalid versionPattern passed to versionCheck: '+ + versionPattern); + return false; + } + }, + + isWebStartInstalled:function(minimumVersion){ + + var browser=deployJava.getBrowser(); + if((browser=='?')||(browser=='Safari')){ + return true; + } + + if(minimumVersion=='undefined'||minimumVersion==null){ + minimumVersion='1.4.2'; + } + + var retval=false; + var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$"; + var matchData=minimumVersion.match(regex); + + if(matchData!=null){ + retval=deployJava.versionCheck(minimumVersion+'+'); + }else{ + if(deployJava.debug){ + alert('Invalid minimumVersion argument to isWebStartInstalled(): '+minimumVersion); + } + retval=deployJava.versionCheck('1.4.2+'); + } + return retval; + }, + + createWebStartLaunchButton:function(jnlp,minimumVersion){ + + if(deployJava.returnPage==null){ + deployJava.returnPage=jnlp; + } + var url='javascript:'+'if (!deployJava.isWebStartInstalled("'+ + minimumVersion+'")) {'+'if (deployJava.installLatestJRE()) {'+'if (deployJava.launch("'+jnlp+'")) {}'+'}'+'} else {'+'if (deployJava.launch("'+jnlp+'")) {}'+'}';document.write('<'+'a href="'+url+'" onMouseOver="window.status=\'\'; '+'return true;"><'+'img '+'src="'+deployJava.launchButtonPNG+'" '+'border="0" /><'+'/'+'a'+'>'); + }, + + launch:function(jnlp){ + if(deployJava.isPluginInstalled()){ + return deployJava.getPlugin().launch(jnlp); + }else{ + document.location=jnlp;return true; + } + }, + + isPluginInstalled:function(){ + var plugin=deployJava.getPlugin(); + if(plugin&&plugin.jvms){ + return true; + }else{ + return false; + } + }, + + isAutoUpdateEnabled:function(){ + if(deployJava.isPluginInstalled()){ + return deployJava.getPlugin().isAutoUpdateEnabled(); + } + return false; + }, + + setAutoUpdateEnabled:function(){ + if(deployJava.isPluginInstalled()){ + return deployJava.getPlugin().setAutoUpdateEnabled(); + } + return false; + }, + + setInstallerType:function(type){ + deployJava.installType=type; + if(deployJava.isPluginInstalled()){ + return deployJava.getPlugin().setInstallerType(type); + } + return false; + }, + + setAdditionalPackages:function(packageList){ + if(deployJava.isPluginInstalled()){ + return deployJava.getPlugin().setAdditionalPackages( + packageList); + } + return false; + }, + + setEarlyAccess:function(enabled){ + deployJava.EAInstallEnabled=enabled; + }, + + isPlugin2:function(){ + if(deployJava.isPluginInstalled()){ + if(deployJava.versionCheck('1.6.0_10+')){ + try{ + return deployJava.getPlugin().isPlugin2(); + }catch(err){ + + } + } + } + return false; + }, + + + getPlugin:function(){ + deployJava.refresh(); + var ret=document.getElementById('deployJavaPlugin'); + return ret; + }, + + compareVersionToPattern:function(version,patternArray,familyMatch){ + var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$"; + var matchData=version.match(regex); + + if(matchData!=null){ + var index=0; + var result=new Array(); + + for(var i=1;i<matchData.length;++i){ + if((typeof matchData[i]=='string')&&(matchData[i]!='')) + { + result[index]=matchData[i]; + index++; + } + } + + var l=Math.min(result.length,patternArray.length); + + if(familyMatch){ + for(var i=0;i<l;++i){ + if(result[i]!=patternArray[i])return false; + } + + return true; + }else{ + for(var i=0;i<l;++i){ + if(result[i]<patternArray[i]){ + return false; + }else if(result[i]>patternArray[i]){ + return true; + } + } + + return true; + } + }else{ + return false; + } + }, + + + getBrowser:function(){ + var browser=navigator.userAgent.toLowerCase(); + + if(deployJava.debug){ + alert('userAgent -> '+browser); + } + + if((navigator.vendor)&& + (navigator.vendor.toLowerCase().indexOf('apple')!=-1)&& + (browser.indexOf('safari')!=-1)){ + if(deployJava.debug){ + alert('We claim to have detected "Safari".'); + } + return'Safari'; + }else if(browser.indexOf('msie')!=-1){ + if(deployJava.debug){ + alert('We claim to have detected "IE".'); + } + return'MSIE'; + }else if((browser.indexOf('mozilla')!=-1)|| + (browser.indexOf('firefox')!=-1)){ + if(deployJava.debug){ + alert('We claim to have detected a Netscape family browser.'); + } + return'Netscape Family'; + }else{ + if(deployJava.debug){ + alert('We claim to have failed to detect a browser.'); + } + return'?'; + } + }, + + + testUsingActiveX:function(version){ + var objectName='JavaWebStart.isInstalled.'+version+'.0'; + + if(!ActiveXObject){ + if(deployJava.debug){ + alert('Browser claims to be IE, but no ActiveXObject object?'); + } + return false; + } + + try{ + return(new ActiveXObject(objectName)!=null); + }catch(exception){ + return false; + } + }, + + + testForMSVM:function(){ + var clsid='{08B0E5C0-4FCB-11CF-AAA5-00401C608500}'; + + if(typeof oClientCaps!='undefined'){ + var v=oClientCaps.getComponentVersion(clsid,"ComponentID"); + if((v=='')||(v=='5,0,5000,0')){ + return false; + }else{ + return true; + } + }else{ + return false; + } + }, + + + testUsingMimeTypes:function(version){ + if(!navigator.mimeTypes){ + if(deployJava.debug){ + alert('Browser claims to be Netscape family, but no mimeTypes[] array?'); + } + return false; + } + + for(var i=0;i<navigator.mimeTypes.length;++i){ + s=navigator.mimeTypes[i].type; + var m=s.match(/^application\/x-java-applet\x3Bversion=(1\.8|1\.7|1\.6|1\.5|1\.4\.2)$/); + if(m!=null){ + if(deployJava.compareVersions(m[1],version)){ + return true; + } + } + } + return false; + }, + + + testUsingPluginsArray:function(version){ + if((!navigator.plugins)||(!navigator.plugins.length)){ + return false; + } + var platform=navigator.platform.toLowerCase(); + for(var i=0;i<navigator.plugins.length;++i){ + s=navigator.plugins[i].description; + + if(s.search(/^Java Switchable Plug-in (Cocoa)/)!=-1){ + if(deployJava.compareVersions("1.5.0",version)){ + return true; + } + }else if(s.search(/^Java/)!=-1){ + if(platform.indexOf('win')!=-1){ + if(deployJava.compareVersions("1.5.0",version)||deployJava.compareVersions("1.6.0",version)){ + return true; + } + } + } + } + if(deployJava.compareVersions("1.5.0",version)){ + return true; + } + return false; + }, + + IEInstall:function(){ + + location.href=deployJava.getJavaURL+ + ((deployJava.returnPage!=null)? + ('&returnPage='+deployJava.returnPage):'')+ + ((deployJava.locale!=null)? + ('&locale='+deployJava.locale):'')+ + ((deployJava.brand!=null)?('&brand='+deployJava.brand):'')+ + ((deployJava.installType!=null)? + ('&type='+deployJava.installType):''); + return false; + }, + + done:function(name,result){ + }, + + FFInstall:function(){ + + location.href=deployJava.getJavaURL+ + ((deployJava.returnPage!=null)? + ('&returnPage='+deployJava.returnPage):'')+ + ((deployJava.locale!=null)? + ('&locale='+deployJava.locale):'')+ + ((deployJava.brand!=null)?('&brand='+deployJava.brand):'')+ + ((deployJava.installType!=null)? + ('&type='+deployJava.installType):''); + return false; + }, + + compareVersions:function(installed,required){ + + var a=installed.split('.'); + var b=required.split('.'); + + for(var i=0;i<a.length;++i){ + a[i]=Number(a[i]); + } + for(var i=0;i<b.length;++i){ + b[i]=Number(b[i]); + } + if(a.length==2){ + a[2]=0; + } + + if(a[0]>b[0])return true; + if(a[0]<b[0])return false; + + if(a[1]>b[1])return true; + if(a[1]<b[1])return false; + + if(a[2]>b[2])return true; + if(a[2]<b[2])return false; + + return true; + }, + + + enableAlerts:function(){ + deployJava.debug=true; + }, + + poll:function(){ + + deployJava.refresh(); + var postInstallJREList=deployJava.getJREs(); + + if((deployJava.preInstallJREList.length==0)&& + (postInstallJREList.length!=0)){ + clearInterval(deployJava.myInterval); + if(deployJava.returnPage!=null){ + location.href=deployJava.returnPage; + }; + } + + if((deployJava.preInstallJREList.length!=0)&& + (postInstallJREList.length!=0)&& + (deployJava.preInstallJREList[0]!=postInstallJREList[0])){ + clearInterval(deployJava.myInterval); + if(deployJava.returnPage!=null){ + location.href=deployJava.returnPage; + } + } + + }, + + writePluginTag:function(){ + var browser=deployJava.getBrowser(); + if(browser=='MSIE'){ + document.write('<'+ + 'object classid="clsid:CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA" '+ + 'id="deployJavaPlugin" width="0" height="0">'+ + '<'+'/'+'object'+'>'); + }else if(browser=='Netscape Family'){ + deployJava.writeEmbedTag(); + } + }, + + refresh:function(){ + navigator.plugins.refresh(false);var browser=deployJava.getBrowser();if(browser=='Netscape Family'){ + var plugin=document.getElementById('deployJavaPlugin');if(plugin==null){ + deployJava.writeEmbedTag(); + } + } + }, + + writeEmbedTag:function(){ + var written=false;if(navigator.mimeTypes!=null){ + for(var i=0;i<navigator.mimeTypes.length;i++){ + if(navigator.mimeTypes[i].type==deployJava.mimeType){ + if(navigator.mimeTypes[i].enabledPlugin){ + document.write('<'+'embed id="deployJavaPlugin" type="'+ + deployJava.mimeType+'" hidden="true" />');written=true; + } + } + } + if(!written)for(var i=0;i<navigator.mimeTypes.length;i++){ + if(navigator.mimeTypes[i].type==deployJava.oldMimeType){ + if(navigator.mimeTypes[i].enabledPlugin){ + document.write('<'+'embed id="deployJavaPlugin" type="'+ + deployJava.oldMimeType+'" hidden="true" />'); + } + } + } + } + }, + + do_initialize:function(){ + deployJava.writePluginTag(); + if(deployJava.locale==null){ + var loc=null; + + if(loc==null)try{ + loc=navigator.userLanguage; + }catch(err){} + + if(loc==null)try{ + loc=navigator.systemLanguage; + }catch(err){} + + if(loc==null)try{ + loc=navigator.language; + }catch(err){} + + if(loc!=null){ + loc.replace("-","_") + deployJava.locale=loc; + } + } + } + + }; + deployJava.do_initialize(); + |