diff options
author | Bojan Suzic <bojan.suzic@iaik.tugraz.at> | 2014-06-12 19:58:43 +0200 |
---|---|---|
committer | Bojan Suzic <bojan.suzic@iaik.tugraz.at> | 2014-06-12 19:58:43 +0200 |
commit | d242908f5f71864403ac930e1a168f96333157ad (patch) | |
tree | 9e490eaf8d2bc2b433d6410c25551896abc90ce1 /id | |
parent | e9bbb948534d4aaf3e7efff95b4484d81242f819 (diff) | |
download | moa-id-spss-d242908f5f71864403ac930e1a168f96333157ad.tar.gz moa-id-spss-d242908f5f71864403ac930e1a168f96333157ad.tar.bz2 moa-id-spss-d242908f5f71864403ac930e1a168f96333157ad.zip |
adding gmbh company type
Diffstat (limited to 'id')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java index 95b59314d..1d081fb1c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java @@ -31,6 +31,7 @@ import java.io.StringWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; +import java.util.regex.Pattern; /** * @@ -131,6 +132,18 @@ public class MandateRetrievalRequest implements IAction { String eLPIdentifier = geteLPIdentifier(mandateContainer, currentAttribute); PersonalAttribute personalAttribute = new PersonalAttribute(currentAttribute.getName(), currentAttribute.isRequired(), Arrays.asList(eLPIdentifier), "Available"); attributeList.add(personalAttribute); + } else if (currentAttribute.getName().equals("type")) { + String type = getCompanyType(mandateContainer, currentAttribute); + PersonalAttribute personalAttribute; + if (type.length() > 0) { + attributeList.add(new PersonalAttribute(currentAttribute.getName(), currentAttribute.isRequired(), Arrays.asList(type), "Available")); + } else { + attributeList.add(new PersonalAttribute(currentAttribute.getName(), currentAttribute.isRequired(), Arrays.asList(type), "NotAvailable")); + } + } else if (currentAttribute.getName().equals("translatableType")) { + String translatableType = ""; + PersonalAttribute personalAttribute = new PersonalAttribute(currentAttribute.getName(), currentAttribute.isRequired(), Arrays.asList(translatableType), "Available"); + attributeList.add(personalAttribute); } } @@ -241,6 +254,25 @@ public class MandateRetrievalRequest implements IAction { } + private String getCompanyType(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException { + String legalName = getLegalName(mandateContainer, sourceAttribute); + + ArrayList<Pattern> gmbhPatterns = new ArrayList<Pattern>(); + gmbhPatterns.add(Pattern.compile(".+ gmbh$", Pattern.CASE_INSENSITIVE)); + gmbhPatterns.add(Pattern.compile(".+ Handelsges\\.m\\.b\\.H\\.$", Pattern.CASE_INSENSITIVE)); + gmbhPatterns.add(Pattern.compile(".+ Gesellschaft m\\.b\\.H\\.$", Pattern.CASE_INSENSITIVE)); + gmbhPatterns.add(Pattern.compile(".+ gesmbh$", Pattern.CASE_INSENSITIVE)); + + for (Pattern pattern : gmbhPatterns) { + if (pattern.matcher(legalName).matches()) { + return "GmbH"; + } + } + + return ""; + } + + private RepresentationPersonType getRepresentative(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) { RepresentationPersonType representative = new RepresentationPersonType(); |