summaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java')
-rw-r--r--src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java b/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java
index 67873f3..66fa155 100644
--- a/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java
+++ b/src/main/java/at/gv/util/config/EgovUtilPropertiesConfiguration.java
@@ -36,6 +36,8 @@ import at.gv.util.ssl.JaxWsSSLConfiguration;
import at.gv.util.ssl.JaxWsSSLConfigurationPropertiesImpl;
import at.gv.util.xsd.szr.pvp.Param;
import at.gv.util.xsd.szr.pvp.PvpTokenType;
+import at.gv.util.xsd.szr.pvp.PvpTokenType.Accounting;
+import at.gv.util.xsd.szr.pvp.PvpTokenType.Accounting.GvCostCenterId;
import at.gv.util.xsd.szr.pvp.PvpTokenType.Authenticate;
import at.gv.util.xsd.szr.pvp.PvpTokenType.Authenticate.UserPrincipal;
import at.gv.util.xsd.szr.pvp.PvpTokenType.Authorize;
@@ -212,12 +214,18 @@ public class EgovUtilPropertiesConfiguration implements EgovUtilConfiguration {
String[] roles = roleString.split(",");
+ String costCenterId = props.getProperty("egovutil." + prefix + ".token.costCenterId");
+ String invoiceRecptId = props.getProperty("egovutil." + prefix + ".token.invoiceRecptId");
+
token.setVersion(version);
- // create authentication information
+ // create authentication information
Authenticate authenticate = new Authenticate();
authenticate.setParticipantId(participantId);
authenticate.setGvOuDomain(gvOuDomain);
+ token.setAuthenticate(authenticate);
+
+ //set UserPrincipal
UserPrincipal up = new UserPrincipal();
up.setCn(cn);
up.setGvFunction(gvFunction);
@@ -226,8 +234,31 @@ public class EgovUtilPropertiesConfiguration implements EgovUtilConfiguration {
up.setGvSecClass(secClass);
up.setOu(ou);
up.setUserId(userId);
- authenticate.setUserPrincipal(up);
- token.setAuthenticate(authenticate);
+ authenticate.setUserPrincipal(up);
+
+ //set Accountuing information
+ if (MiscUtil.isNotEmpty(invoiceRecptId) || MiscUtil.isNotEmpty(costCenterId)) {
+ Accounting accounting = new Accounting();
+ accounting.setInvoiceRecptId(invoiceRecptId);
+
+ if (MiscUtil.isNotEmpty(costCenterId)) {
+ List<GvCostCenterId> gvCostCenterId = accounting.getGvCostCenterId();
+ String[] costCenterIdList = costCenterId.split(",");
+ for (String el : costCenterIdList) {
+ GvCostCenterId id = new GvCostCenterId();
+ id.setValue(el);
+
+ //first element is marked as 'Default'
+ if (gvCostCenterId.isEmpty())
+ id.setDefault(true);
+ gvCostCenterId.add(id);
+
+ }
+
+ }
+ token.setAccounting(accounting);
+
+ }
// set roles
Authorize authorize = new Authorize();