aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-03-27 11:31:15 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-03-27 11:31:15 +0100
commit798ea7ddc50fcf65cb184b0161e6869b5e47e416 (patch)
tree05fa729b3ded102a75eaf61fdc520f4aad658779 /id/server/idserverlib
parenta0563d6f2cbb9a41d59aa30c463376232b1df105 (diff)
downloadmoa-id-spss-798ea7ddc50fcf65cb184b0161e6869b5e47e416.tar.gz
moa-id-spss-798ea7ddc50fcf65cb184b0161e6869b5e47e416.tar.bz2
moa-id-spss-798ea7ddc50fcf65cb184b0161e6869b5e47e416.zip
update STORK country selection
Diffstat (limited to 'id/server/idserverlib')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java23
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java31
2 files changed, 49 insertions, 5 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java
index 060dc2248..0173c67a1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java
@@ -4,7 +4,10 @@
package at.gv.egovernment.moa.id.auth;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import iaik.asn1.ObjectID;
@@ -133,4 +136,24 @@ public interface MOAIDAuthConstants {
public static final String PARAM_APPLET_HEIGTH = "heigth";
public static final String PARAM_APPLET_WIDTH = "width";
+ public static final Map<String, String> COUNTRYCODE_XX_TO_NAME =
+ Collections.unmodifiableMap(new HashMap<String, String>() {
+ private static final long serialVersionUID = 1L;
+ {
+ put("BE", "Belgi&euml;/Belgique");
+ put("EE", "Eesti");
+ put("ES", "Espa&ntilde;a");
+ put("FI", "Suomi");
+ put("IS", "&Iacute;sland");
+ put("IT", "Italia");
+ put("LI", "Liechtenstein");
+ put("LT", "Lithuania");
+ put("LU", "Luxemburg");
+ put("PT", "Portugal");
+ put("SE", "Sverige");
+ put("SI", "Slovenija");
+ }
+ });
+
+
}
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 c244b64e9..4d80be1e8 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
@@ -31,9 +31,11 @@ import java.io.InputStream;
import java.io.StringWriter;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.List;
import org.apache.commons.io.IOUtils;
+import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS;
import at.gv.egovernment.moa.id.config.ConfigurationException;
@@ -152,11 +154,30 @@ public class LoginFormBuilder {
if (oaParam.isShowStorkLogin()) {
String pepslist = "";
- for (CPEPS current : oaParam.getPepsList())
- // check if master config has changed...
- if(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS().contains(current))
- pepslist += "<option value=" + current.getCountryCode() + ">" + current.getCountryCode() + "</option>\n";
- value = value.replace(PEPSLIST, pepslist);
+ List<CPEPS> cpepsList = null;
+ try {
+ cpepsList = ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS();
+
+ for (CPEPS current : oaParam.getPepsList())
+ // check if master config has changed...
+ if(cpepsList != null && cpepsList.contains(current)) {
+ String countryName = null;
+ if (MiscUtil.isNotEmpty(MOAIDAuthConstants.COUNTRYCODE_XX_TO_NAME.get(current.getCountryCode().toUpperCase())))
+ countryName = MOAIDAuthConstants.COUNTRYCODE_XX_TO_NAME.get(current.getCountryCode().toUpperCase());
+ else
+ countryName = current.getCountryCode().toUpperCase();
+
+ pepslist += "<option value=" + current.getCountryCode() + ">"
+ + countryName
+ + "</option>\n";
+
+ }
+
+ value = value.replace(PEPSLIST, pepslist);
+
+ } catch (NullPointerException e) {
+
+ }
}
value = FormBuildUtils.customiceLayoutBKUSelection(value,