aboutsummaryrefslogtreecommitdiff
path: root/id/server
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2013-10-16 20:09:40 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2013-10-16 20:09:40 +0200
commit8d417057d38d56510a1d3d2e39381a1df3dd96ee (patch)
tree26e2d71409bdb10a5fefad1b538af583e984b776 /id/server
parenta7c22b659f5bc760cb46d5892409dab12cc047d6 (diff)
downloadmoa-id-spss-8d417057d38d56510a1d3d2e39381a1df3dd96ee.tar.gz
moa-id-spss-8d417057d38d56510a1d3d2e39381a1df3dd96ee.tar.bz2
moa-id-spss-8d417057d38d56510a1d3d2e39381a1df3dd96ee.zip
@ConfigWebTool
--add JS ColorPicker to select colors easier --add BKUSelectionFrom preview --add useMandate checkbox --change position of some checkboxes in OA configuration @MOAID lib --change API of BKUFormCustomization utils
Diffstat (limited to 'id/server')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java50
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java5
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java23
-rw-r--r--id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html186
-rw-r--r--id/server/idserverlib/src/main/resources/resources/templates/sendAssertionFormFull.html38
5 files changed, 180 insertions, 122 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java
index 729af48f7..a00ae4ccf 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java
@@ -7,9 +7,11 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.net.URI;
+import java.net.URISyntaxException;
import org.apache.commons.io.IOUtils;
+import at.gv.egovernment.moa.id.config.ConfigurationException;
import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
import at.gv.egovernment.moa.id.protocols.saml1.SAML1Protocol;
@@ -29,32 +31,42 @@ public class LoginFormBuilder {
private static String BKU_ONLINE = "#ONLINE#";
private static String BKU_HANDY = "#HANDY#";
private static String BKU_LOCAL = "#LOCAL#";
- private static String CONTEXTPATH = "#CONTEXTPATH#";
+ public static String CONTEXTPATH = "#CONTEXTPATH#";
private static String MOASESSIONID = "#SESSIONID#";
private static String SERVLET = CONTEXTPATH+"/GenerateIframeTemplate";
- private static String getTemplate() {
+ public static String getTemplate() {
+ String pathLocation ="";
+ InputStream input = null;
+
+ try {
+ String rootconfigdir = AuthConfigurationProvider.getInstance().getRootConfigFileDir();
+ pathLocation = rootconfigdir + HTMLTEMPLATESDIR + HTMLTEMPLATEFULL;
+ File file = new File(new URI(pathLocation));
+ input = new FileInputStream(file);
+
+ } catch (ConfigurationException e) {
+ Logger.warn("MOA-ID configuration can not be loaded.");
+
+ } catch (Exception e) {
+
+ }
+
+ return getTemplate(input);
+
+ }
+
+ public static String getTemplate(InputStream input) {
String template = null;
- InputStream input = null;
try {
- String pathLocation;
-
- String rootconfigdir = AuthConfigurationProvider.getInstance().getRootConfigFileDir();
- pathLocation = rootconfigdir + HTMLTEMPLATESDIR + HTMLTEMPLATEFULL;
-
- try {
- File file = new File(new URI(pathLocation));
- input = new FileInputStream(file);
-
- } catch (FileNotFoundException e) {
+ if (input == null) {
Logger.warn("No LoginFormTempaltes found. Use Generic Templates from package.");
- pathLocation = "resources/templates/" + HTMLTEMPLATEFULL;
-
+ String pathLocation = "resources/templates/" + HTMLTEMPLATEFULL;
input = Thread.currentThread()
.getContextClassLoader()
.getResourceAsStream(pathLocation);
@@ -82,7 +94,7 @@ public class LoginFormBuilder {
}
return template;
}
-
+
public static String buildLoginForm(String modul, String action, OAAuthParameter oaParam, String contextpath, String moaSessionID) {
String value = getTemplate();
@@ -99,10 +111,12 @@ public class LoginFormBuilder {
value = value.replace(CONTEXTPATH, contextpath);
value = value.replace(MOASESSIONID, moaSessionID);
- value = FormBuildUtils.customiceLayoutBKUSelection(value, oaParam);
+ value = FormBuildUtils.customiceLayoutBKUSelection(value,
+ oaParam.isShowMandateCheckBox(),
+ oaParam.isOnlyMandateAllowed(),
+ oaParam.getFormCustomizaten());
}
return value;
}
-
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java
index 1617ef796..b763afd65 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java
@@ -98,7 +98,10 @@ public class SendAssertionFormBuilder {
value = value.replace(OANAME, oaParam.getFriendlyName());
value = value.replace(CONTEXTPATH, contextpath);
- value = FormBuildUtils.customiceLayoutBKUSelection(value, oaParam);
+ value = FormBuildUtils.customiceLayoutBKUSelection(value,
+ oaParam.isShowMandateCheckBox(),
+ oaParam.isOnlyMandateAllowed(),
+ oaParam.getFormCustomizaten());
}
return value;
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java
index 533957cc8..e8af82872 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/FormBuildUtils.java
@@ -5,6 +5,7 @@ import java.util.Map;
import java.util.Set;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+import at.gv.egovernment.moa.util.MiscUtil;
public class FormBuildUtils {
@@ -43,21 +44,22 @@ public class FormBuildUtils {
defaultmap.put(BUTTON_BACKGROUNDCOLOR_FOCUS, "#EBEBEB");
defaultmap.put(BUTTON_COLOR, "#000000");
- defaultmap.put(FONTFAMILY, "Verdana, Geneva, Arial, sans-serif");
+ defaultmap.put(FONTFAMILY, "Verdana,Geneva,Arial,sans-serif");
defaultmap.put(REDIRECTTARGET, "_top");
}
}
- public static String customiceLayoutBKUSelection(String value, OAAuthParameter oaParam) {
+ public static String customiceLayoutBKUSelection(String value, boolean isShowMandateCheckbox,
+ boolean isOnlyMandateAllowed, Map<String, String> map) {
- if (oaParam.isShowMandateCheckBox())
+ if (isShowMandateCheckbox)
value = value.replace(MANDATEVISIBLE, "");
else
value = value.replace(MANDATEVISIBLE, TEMPLATEVISIBLE);
- if (oaParam.isOnlyMandateAllowed()) {
+ if (isOnlyMandateAllowed) {
value = value.replace(MANDATECHECKED, TEMPLATECHECKED + " " +
TEMPLATEDISABLED + " " +
TEMPLATE_ARIACHECKED + "\"true\"");
@@ -65,7 +67,18 @@ public class FormBuildUtils {
} else
value = value.replace(MANDATECHECKED, TEMPLATE_ARIACHECKED + "\"false\"");
- Map<String, String> map = oaParam.getFormCustomizaten();
+ String fonttype = map.get(FONTFAMILY);
+ if (MiscUtil.isNotEmpty(fonttype)) {
+ String[] fonttypeList = fonttype.split(",");
+ String fonttypeformated = "\"" + fonttypeList[0].trim().replace("\"", "") + "\"";
+
+ for (int i=1; i<fonttypeList.length; i++) {
+ fonttypeformated += ",\"" + fonttypeList[i].trim().replace("\"", "") + "\"";
+ }
+
+ map.put(FONTFAMILY, fonttypeformated);
+ }
+
Set<String> elements = map.keySet();
for (String element: elements) {
value = value.replace(element, map.get(element));
diff --git a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html
index efc3e8d9d..99a66727b 100644
--- a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html
+++ b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html
@@ -22,13 +22,14 @@
#localBKU input{
font-size: 0.7em;
- border-radius: 5px;
+ /*border-radius: 5px;*/
}
- #bkuselectionarea button {
+ #bkuselectionarea input[type=button] {
font-size: 0.85em;
- border-radius: 7px;
+ /*border-radius: 7px;*/
margin-bottom: 25px;
+ min-width: 80px;
}
#mandateLogin {
@@ -132,7 +133,7 @@
button {
height: 25px;
- width: 90px;
+ width: 75px;
margin-bottom: 10px;
}
@@ -153,16 +154,16 @@
#localBKU input {
font-size: 0.6em;
min-width: 60px;
- max-width: 65px;
+ /* max-width: 65px; */
min-height: 1.0em;
- border-radius: 5px;
+ /* border-radius: 5px; */
}
- #bkuselectionarea button {
- font-size: 0.8em;
- min-width: 65px;
- min-height: 1.3em;
- border-radius: 5px;
+ #bkuselectionarea input[type=button] {
+ font-size: 0.7em;
+ min-width: 55px;
+ /*min-height: 1.1em;
+ border-radius: 5px;*/
margin-bottom: 2%
}
@@ -171,8 +172,13 @@
}
#bku_header h2 {
- font-size: 0.8em;
- margin-top: -0.4em;
+ font-size: 0.75em;
+ margin-top: -0.37em;
+ padding-top: 0.37em;
+ }
+
+ #bkulogin {
+ min-height: 150px;
}
}
@@ -184,16 +190,16 @@
#localBKU input {
font-size: 0.7em;
min-width: 70px;
- max-width: 75px;
+ /* max-width: 75px; */
min-height: 0.95em;
- border-radius: 6px;
+ /* border-radius: 6px; */
}
- #bkuselectionarea button{
- font-size: 0.85em;
- min-width: 70px;
- min-height: 0.95em;
- border-radius: 6px;
+ #bkuselectionarea input[type=button] {
+ font-size: 0.75em;
+ min-width: 60px;
+ /* min-height: 0.95em;
+ border-radius: 6px; */
margin-bottom: 5%
}
@@ -202,9 +208,14 @@
}
#bku_header h2 {
- font-size: 0.9em;
- margin-top: -0.45em;
- }
+ font-size: 0.8em;
+ margin-top: -0.40em;
+ padding-top: 0.40em;
+ }
+
+ #bkulogin {
+ min-height: 180px;
+ }
}
@media screen and (max-width: 299px) and (min-width: 250px) {
@@ -215,14 +226,14 @@
#localBKU input {
font-size: 0.8em;
min-width: 70px;
- max-width: 75px;
- border-radius: 6px;
+ /* max-width: 75px; */
+ /* border-radius: 6px; */
}
- #bkuselectionarea button {
- font-size: 1.0em;
- min-height: 1.05em;
- border-radius: 7px;
+ #bkuselectionarea input[type=button] {
+ font-size: 0.85em;
+ /* min-height: 1.05em;
+ border-radius: 7px; */
margin-bottom: 10%;
}
@@ -231,8 +242,9 @@
}
#bku_header h2 {
- font-size: 1.0em;
- margin-top: -0.50em;
+ font-size: 0.9em;
+ margin-top: -0.45em;
+ padding-top: 0.45em;
}
}
@@ -244,15 +256,16 @@
#localBKU input {
font-size: 0.8em;
min-width: 70px;
- max-width: 75px;
- border-radius: 6px;
+ /* max-width: 75px; */
+ /* border-radius: 6px; */
}
- #bkuselectionarea button {
- font-size: 1.1em;
- min-height: 1.2em;
- border-radius: 8px;
+ #bkuselectionarea input[type=button] {
+ font-size: 0.9em;
+ /* min-height: 1.2em;
+ border-radius: 8px; */
margin-bottom: 10%;
+ max-width: 80px;
}
#mandateLogin {
@@ -262,6 +275,7 @@
#bku_header h2 {
font-size: 1.1em;
margin-top: -0.55em;
+ padding-top: 0.55em;
}
}
@@ -273,15 +287,16 @@
#localBKU input {
font-size: 0.8em;
min-width: 70px;
- max-width: 80px;
- border-radius: 6px;
+ /* max-width: 80px; */
+ /* border-radius: 6px; */
}
- #bkuselectionarea button {
- font-size: 1.3em;
- min-height: 1.3em;
- border-radius: 10px;
+ #bkuselectionarea input[type=button] {
+ font-size: 1.0em;
+ /* min-height: 1.3em;
+ border-radius: 10px; */
margin-bottom: 10%;
+ max-width: 85px;
}
#mandateLogin {
@@ -291,6 +306,7 @@
#bku_header h2 {
font-size: 1.3em;
margin-top: -0.65em;
+ padding-top: 0.65em;
}
}
@@ -337,9 +353,9 @@
margin-bottom: 0px;
text-align: left;
border:none;
- min-width: 190px;
- min-height: 190px;
vertical-align: middle;
+ min-height: 173px;
+ min-width: 204px;
}
@@ -352,14 +368,13 @@
h2#tabheader{
padding-left: 2%;
padding-right: 2%;
- padding-top: 1%;
position: relative;
top: 50%;
}
#bkulogin {
min-width: 190px;
- min-height: 150px;
+ min-height: 155px;
}
.setAssertionButton_full {
@@ -370,8 +385,8 @@
height: 25px;
}
- button {
- height: 11%;
+ input[type=button] {
+/* height: 11%; */
width: 70%;
}
}
@@ -379,7 +394,6 @@
* {
margin: 0;
padding: 0;
- border: 0;
font-family: "#FONTTYPE#";
}
@@ -416,8 +430,8 @@
}
#mandateLogin {
- padding-bottom: 2%;
- padding-top: 2%;
+ padding-bottom: 4%;
+ padding-top: 4%;
height: 10%;
position: relative;
text-align: center;
@@ -442,7 +456,8 @@
#localBKU {
padding-left: 5%;
padding-right: 2%;
- padding-bottom: 2%;
+ padding-bottom: 4%;
+ padding-top: 4%;
position: relative;
clear: both;
}
@@ -474,31 +489,42 @@
text-align:center;
padding : 5px 5px 5px 5px;
}
-
- button, .sendButton {
+
+/* input[type=button], .sendButton {
background: #BUTTON_BACKGROUNDCOLOR#;
color: #BUTTON_COLOR#;
- border:1px solid #000;
- cursor: pointer;
- box-shadow: 3px 3px 3px #222222;
- }
+/* border:1px solid #000; */
+/* cursor: pointer;
+/* box-shadow: 3px 3px 3px #222222; */
+/* }
- button:hover, button:focus, button:active,
+/* button:hover, button:focus, button:active,
.sendButton:hover , .sendButton:focus, .sendButton:active,
#mandateCheckBox:hover, #mandateCheckBox:focus, #mandateCheckBox:active {
background: #BUTTON_BACKGROUNDCOLOR_FOCUS#;
color: #BUTTON_COLOR#;
- border:1px solid #000;
- cursor: pointer;
- box-shadow: -1px -1px 3px #222222;
- }
-
+/* border:1px solid #000; */
+/* cursor: pointer;
+/* box-shadow: -1px -1px 3px #222222; */
+/* }
+*/
input {
- border:1px solid #000;
+ /*border:1px solid #000;*/
cursor: pointer;
}
+
+ #localBKU input {
+/* color: #BUTTON_COLOR#; */
+ border: 0px;
+ display: inline-block;
+
+ }
+ #localBKU input:hover, #localBKU input:focus, #localBKU input:active {
+ text-decoration: underline;
+ }
+
#installJava, #BrowserNOK {
clear:both;
font-size:0.8em;
@@ -656,14 +682,14 @@
var width = el.clientWidth;
var heigth = el.clientHeight - 20;
var parent = el.parentNode;
-
+
iFrameURL += "&heigth=" + heigth;
iFrameURL += "&width=" + width;
var iframe = document.createElement("iframe");
iframe.setAttribute("src", iFrameURL);
- iframe.setAttribute("width", width);
- iframe.setAttribute("height", el.clientHeight);
+ iframe.setAttribute("width", el.clientWidth - 1);
+ iframe.setAttribute("height", el.clientHeight - 1);
iframe.setAttribute("frameborder", "0");
iframe.setAttribute("scrolling", "no");
iframe.setAttribute("title", "Login");
@@ -741,23 +767,23 @@
<img class="bkuimage"
src="#CONTEXTPATH#/img/online-bku.png"
alt="OnlineBKU"/>
- <button name="bkuButton"
+ <input name="bkuButtonOnline"
type="button"
onClick="bkuOnlineClicked();"
tabindex="2"
- role="button">KARTE
- </button>
+ role="button"
+ value="Karte"/>
</div>
<div id="bkuhandy">
<img class="bkuimage"
src="#CONTEXTPATH#/img/mobile-bku.png"
alt="HandyBKU"/>
- <button name="bkuButton"
+ <input name="bkuButtonHandy"
type="button"
onClick="bkuHandyClicked();"
tabindex="3"
- role="button">HANDY
- </button>
+ role="button"
+ value="HANDY"/>
</div>
</div>
<div id="localBKU">
@@ -770,13 +796,13 @@
<input type="hidden" name="ACTION" value="#ACTION#">
<input type="hidden" name="MOASessionID" value="#SESSIONID#">
<input type="submit"
- value="lokale BKU"
- class="sendButton"
+ value=">lokale Bürgerkartenumgebung"
tabindex="4"
- role="button">
- <p>
+ role="button"
+ class="hell">
+ <!--p>
<small>Alternativ können Sie eine lokal installierte BKU verwenden.</small>
- </p>
+ </p-->
</form>
</div>
diff --git a/id/server/idserverlib/src/main/resources/resources/templates/sendAssertionFormFull.html b/id/server/idserverlib/src/main/resources/resources/templates/sendAssertionFormFull.html
index cc715fa4f..b80d654cc 100644
--- a/id/server/idserverlib/src/main/resources/resources/templates/sendAssertionFormFull.html
+++ b/id/server/idserverlib/src/main/resources/resources/templates/sendAssertionFormFull.html
@@ -114,7 +114,7 @@
height: 30px;
font-size: 1.3em;
min-height: 1.3em;
- border-radius: 10px;
+/* border-radius: 10px;*/
}
#leftbutton {
@@ -161,7 +161,7 @@
font-size: 0.8em;
min-width: 65px;
min-height: 1.3em;
- border-radius: 5px;
+ /* border-radius: 5px; */
margin-bottom: 2%
}
@@ -191,7 +191,7 @@
font-size: 0.85em;
min-width: 70px;
min-height: 0.95em;
- border-radius: 6px;
+ /* border-radius: 6px; */
margin-bottom: 2%
}
@@ -219,7 +219,7 @@
#bkuselectionarea button, .setAssertionButton_full {
font-size: 1.0em;
min-height: 1.05em;
- border-radius: 7px;
+ /* border-radius: 7px; */
margin-bottom: 5%;
}
@@ -247,7 +247,7 @@
#bkuselectionarea button, .setAssertionButton_full {
font-size: 1.1em;
min-height: 1.2em;
- border-radius: 8px;
+ /* border-radius: 8px; */
margin-bottom: 5%;
}
@@ -275,7 +275,7 @@
#bkuselectionarea button, .setAssertionButton_full {
font-size: 1.3em;
min-height: 1.3em;
- border-radius: 10px;
+/* border-radius: 10px; */
margin-bottom: 5%;
}
@@ -333,7 +333,7 @@
text-align: left;
border:none;
min-width: 190px;
- min-height: 190px;
+/* min-height: 190px; */
vertical-align: middle;
}
@@ -378,7 +378,7 @@
* {
margin: 0;
padding: 0;
- border: 0;
+/* border: 0; */
font-family: #FONTTYPE#;
}
@@ -475,21 +475,23 @@
}
button, .sendButton {
- background: #BUTTON_BACKGROUNDCOLOR#;
- color: #BUTTON_COLOR#;
- border:1px solid #000;
- cursor: pointer;
- box-shadow: 3px 3px 3px #222222;
+/* background: #BUTTON_BACKGROUNDCOLOR#;
+ color: #BUTTON_COLOR#; */
+ cursor: pointer;
+
+/* border:1px solid #000;
+ box-shadow: 3px 3px 3px #222222; */
}
button:hover, button:focus, button:active,
.sendButton:hover , .sendButton:focus, .sendButton:active,
#mandateCheckBox:hover, #mandateCheckBox:focus, #mandateCheckBox:active {
- background: #BUTTON_BACKGROUNDCOLOR_FOCUS#;
- color: #BUTTON_COLOR#;
- border:1px solid #000;
- cursor: pointer;
- box-shadow: -1px -1px 3px #222222;
+/* background: #BUTTON_BACKGROUNDCOLOR_FOCUS#;
+ color: #BUTTON_COLOR#; */
+ cursor: pointer;
+
+/* border:1px solid #000;
+ box-shadow: -1px -1px 3px #222222; */
}
#installJava, #BrowserNOK {