diff options
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java')
-rw-r--r-- | id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java | 216 |
1 files changed, 179 insertions, 37 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java index 57ae4863a..334124cfd 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java @@ -1,6 +1,29 @@ +/******************************************************************************* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + *******************************************************************************/ package at.gv.egovernment.moa.id.configuration.data.oa; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -18,6 +41,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType; import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; import at.gv.egovernment.moa.id.configuration.Constants; +import at.gv.egovernment.moa.id.configuration.validation.TargetValidator; import at.gv.egovernment.moa.util.MiscUtil; @@ -35,19 +59,22 @@ public class OAGeneralConfig { private boolean businessService = false; private String target = null; + private String target_subsector = null; + private String target_admin = null; + private static List<String> targetList = null; private String targetFriendlyName = null; + private boolean isAdminTarget = false; private String identificationNumber = null; private String identificationType = null; + private static List<String> identificationTypeList = null; private String aditionalAuthBlockText = null; private String mandateProfiles = null; + private boolean useMandates = false; private boolean isActive = false; - private String slVersion = null; - private boolean useIFrame = false; - private boolean useUTC = false; private boolean calculateHPI = false; private String keyBoxIdentifier = null; @@ -56,6 +83,8 @@ public class OAGeneralConfig { private boolean legacy = false; List<String> SLTemplates = null; + private boolean isHideBPKAuthBlock = false; + private Map<String, byte[]> transformations; @@ -69,6 +98,14 @@ public class OAGeneralConfig { bkuLocalURL = Constants.DEFAULT_LOCALBKU_URL; bkuHandyURL = Constants.DEFAULT_HANDYBKU_URL; + + targetList = TargetValidator.getListOfTargets(); + target = ""; + + identificationTypeList = Arrays.asList( + Constants.IDENIFICATIONTYPE_FN, + Constants.IDENIFICATIONTYPE_ZVR, + Constants.IDENIFICATIONTYPE_ERSB); } @@ -81,8 +118,29 @@ public class OAGeneralConfig { keyBoxIdentifier = dbOAConfig.getKeyBoxIdentifier().value(); identifier = dbOAConfig.getPublicURLPrefix(); - target = dbOAConfig.getTarget(); - targetFriendlyName = dbOAConfig.getTargetFriendlyName(); + + String target_full = dbOAConfig.getTarget(); + if (MiscUtil.isNotEmpty(target_full)) { + if (TargetValidator.isValidTarget(target_full)) { + target = target_full; + + } else { + String[] target_split = target_full.split("-"); + + if (TargetValidator.isValidTarget(target_split[0])) { + target = target_split[0]; + if (target_split.length > 1) + target_subsector = target_split[1]; + + } else { + target = ""; + target_subsector = null; + target_admin = target_full; + isAdminTarget = true; + } + } + targetFriendlyName = dbOAConfig.getTargetFriendlyName(); + } if (dbOAConfig.getType().equals(Constants.MOA_CONFIG_BUSINESSSERVICE)) businessService = true; @@ -127,16 +185,32 @@ public class OAGeneralConfig { IdentificationNumber idnumber = oaauth.getIdentificationNumber(); if (idnumber != null) { - identificationNumber = idnumber.getValue(); + String number = idnumber.getValue(); + if (MiscUtil.isNotEmpty(number)) { + String[] split = number.split("\\+"); + + if (Constants.PREFIX_WPBK.startsWith(split[0]) && split.length >= 2) { + identificationType = split[1]; + identificationNumber = split[2]; + } + } } Mandates mandates = oaauth.getMandates(); if (mandates != null) { - mandateProfiles = mandates.getProfiles(); + + if (MiscUtil.isNotEmpty(mandates.getProfiles())) { + mandateProfiles = mandates.getProfiles(); + useMandates = true; + + } else { + mandateProfiles = new String(); + useMandates = false; + } + + } - slVersion = oaauth.getSlVersion(); - TemplatesType templates = oaauth.getTemplates(); if (templates != null) { aditionalAuthBlockText = templates.getAditionalAuthBlockText(); @@ -162,12 +236,9 @@ public class OAGeneralConfig { transformations.put(el.getFilename(), el.getTransformation()); } - useIFrame = oaauth.isUseIFrame(); - useUTC = oaauth.isUseUTC(); } - - + isHideBPKAuthBlock = dbOAConfig.isRemoveBPKFromAuthBlock(); } @@ -243,30 +314,6 @@ public class OAGeneralConfig { this.isActive = isActive; } - public String getSlVersion() { - return slVersion; - } - - public void setSlVersion(String slVersion) { - this.slVersion = slVersion; - } - - public boolean isUseIFrame() { - return useIFrame; - } - - public void setUseIFrame(boolean useIFrame) { - this.useIFrame = useIFrame; - } - - public boolean isUseUTC() { - return useUTC; - } - - public void setUseUTC(boolean useUTC) { - this.useUTC = useUTC; - } - public boolean isBusinessService() { return businessService; } @@ -461,6 +508,101 @@ public class OAGeneralConfig { SLTemplates.add(sLTemplateURL3); } + + /** + * @return the target_subsector + */ + public String getTarget_subsector() { + return target_subsector; + } + + + /** + * @param target_subsector the target_subsector to set + */ + public void setTarget_subsector(String target_subsector) { + this.target_subsector = target_subsector; + } + + + /** + * @return the target_admin + */ + public String getTarget_admin() { + return target_admin; + } + + + /** + * @param target_admin the target_admin to set + */ + public void setTarget_admin(String target_admin) { + this.target_admin = target_admin; + } + + + /** + * @return the targetList + */ + public List<String> getTargetList() { + return targetList; + } + + + /** + * @return the identificationTypeList + */ + public List<String> getIdentificationTypeList() { + return identificationTypeList; + } + + + /** + * @return the isAdminTarget + */ + public boolean isAdminTarget() { + return isAdminTarget; + } + + + /** + * @param isAdminTarget the isAdminTarget to set + */ + public void setAdminTarget(boolean isAdminTarget) { + this.isAdminTarget = isAdminTarget; + } + + + /** + * @return the isHideBPKAuthBlock + */ + public boolean isHideBPKAuthBlock() { + return isHideBPKAuthBlock; + } + + + /** + * @param isHideBPKAuthBlock the isHideBPKAuthBlock to set + */ + public void setHideBPKAuthBlock(boolean isHideBPKAuthBlock) { + this.isHideBPKAuthBlock = isHideBPKAuthBlock; + } + + + /** + * @return the useMandates + */ + public boolean isUseMandates() { + return useMandates; + } + + + /** + * @param useMandates the useMandates to set + */ + public void setUseMandates(boolean useMandates) { + this.useMandates = useMandates; + } } |