From 3b2f0109faa906d34172daeec388dc58bf116cb3 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Fri, 13 Jun 2014 19:15:10 +0200 Subject: mandate refactor --- .../protocols/stork2/MandateRetrievalRequest.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'id/server') 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 29a4c23a4..4d306af22 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 @@ -279,12 +279,7 @@ public class MandateRetrievalRequest implements IAction { return "R"; } - - private String getCompanyType(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException { - // retrieve the registered subject name - String legalName = getLegalName(mandateContainer, sourceAttribute); - String legalIdentificationType = getLegalIdentificationType(mandateContainer, sourceAttribute); - + private String getCompanyType(String legalName, String legalIdentificationType, PersonalAttribute sourceAttrivbute) throws MOAIDException { // compile patterns for different organisation types // sources: USP, WKO, LexAndTax @@ -353,6 +348,13 @@ public class MandateRetrievalRequest implements IAction { return ""; } + private String getCompanyType(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException { + // retrieve the registered subject name and identification type + String legalName = getLegalName(mandateContainer, sourceAttribute); + String legalIdentificationType = getLegalIdentificationType(mandateContainer, sourceAttribute); + return getCompanyType(legalName, legalIdentificationType, sourceAttribute); + } + private String getCompanyTranslatableType(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException { // retrieve first the company type String companyType = getCompanyType(mandateContainer, sourceAttribute); @@ -390,11 +392,12 @@ public class MandateRetrievalRequest implements IAction { RepresentationPersonType represented = new RepresentationPersonType(); if (mandateContainer instanceof CorporateBodyMandateContainer) { - represented.setELPIdentifier(geteLPIdentifier(mandateContainer, sourceAttribute)); - represented.setName(getLegalName(mandateContainer, sourceAttribute)); + CorporateBodyMandateContainer corporateBodyMandateContainer = (CorporateBodyMandateContainer)mandateContainer; + represented.setELPIdentifier("AT/" + corporateBodyMandateContainer.getCorpMandatorIdentificationValue()); + represented.setName(corporateBodyMandateContainer.getCorpMandatorFullName()); represented.setAddress(""); represented.setCanonicalAddress(new CanonicalAddressType()); - represented.setType(getCompanyType(mandateContainer, sourceAttribute)); + represented.setType(getCompanyType(corporateBodyMandateContainer.corpMandatorFullName, corporateBodyMandateContainer.corpMandatorIdentificationType, sourceAttribute)); } else if (mandateContainer instanceof PhyPersonMandateContainer) { PhyPersonMandateContainer phyPersonMandateContainer = (PhyPersonMandateContainer) mandateContainer; represented.setEIdentifier(""); // TODO CALCULATE -- cgit v1.2.3