UNOMI-120 MasterProfile is not saved when a merge is performed
This commit adds the missing call to the persistence service when the master 
profile is updated.

Signed-off-by: Serge Huber <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/9fbdf43a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/9fbdf43a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/9fbdf43a

Branch: refs/heads/feature-UNOMI-117
Commit: 9fbdf43abcdcb3aa5ebae4612f96d698d3e0a28f
Parents: 0703445
Author: Serge Huber <[email protected]>
Authored: Tue Aug 22 17:08:23 2017 +0200
Committer: Serge Huber <[email protected]>
Committed: Tue Aug 22 17:08:23 2017 +0200

----------------------------------------------------------------------
 .../services/ProfileExportServiceImpl.java      | 24 +++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9fbdf43a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
 
b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
index c2bb635..1b35e96 100644
--- 
a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
+++ 
b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
@@ -71,19 +71,21 @@ public class ProfileExportServiceImpl extends 
AbstractCustomServiceImpl implemen
             PropertyType propType = 
RouterUtils.getPropertyTypeById(propertiesDef, propertyName);
             Object propertyValue = profile.getProperty(propertyName);
             if (propType != null && 
BooleanUtils.isTrue(propType.isMultivalued())) {
-                List<String> multiValue = (List<String>) propertyValue;
-
-                lineToWrite += 
StringUtils.isNotBlank(exportConfiguration.getMultiValueDelimiter()) ? 
exportConfiguration.getMultiValueDelimiter().charAt(0) : "";
-                int j = 0;
-                for (String entry : multiValue) {
-                    lineToWrite += entry.replaceAll("\"", "\"\"");
-                    if (j + 1 < multiValue.size()) {
-                        lineToWrite += 
exportConfiguration.getMultiValueSeparator();
+                if (propertyValue != null) {
+                    List<String> multiValue = (List<String>) propertyValue;
+                    lineToWrite += 
StringUtils.isNotBlank(exportConfiguration.getMultiValueDelimiter()) ? 
exportConfiguration.getMultiValueDelimiter().charAt(0) : "";
+                    int j = 0;
+                    for (String entry : multiValue) {
+                        lineToWrite += entry.replaceAll("\"", "\"\"");
+                        if (j + 1 < multiValue.size()) {
+                            lineToWrite += 
exportConfiguration.getMultiValueSeparator();
+                        }
+                        j++;
                     }
-                    j++;
+                    lineToWrite += 
StringUtils.isNotBlank(exportConfiguration.getMultiValueDelimiter()) ? 
exportConfiguration.getMultiValueDelimiter().charAt(1) : "";
+                } else {
+                    lineToWrite += "";
                 }
-                lineToWrite += 
StringUtils.isNotBlank(exportConfiguration.getMultiValueDelimiter()) ? 
exportConfiguration.getMultiValueDelimiter().charAt(1) : "";
-
             } else {
                 if(propertyValue != null) {
                     propertyValue = propertyValue.toString().replaceAll("\"", 
"\"\"");

Reply via email to