[unomi] branch master updated: UNOMI-727: adapt merge system to rollover (and cleanup too) (#588)

2023-03-13 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 385699a5c UNOMI-727: adapt merge system to rollover (and cleanup too) 
(#588)
385699a5c is described below

commit 385699a5cdb771ac8b70d8ea493f43a849b78f86
Author: kevan Jahanshahi 
AuthorDate: Mon Mar 13 16:04:07 2023 +0100

UNOMI-727: adapt merge system to rollover (and cleanup too) (#588)

* UNOMI-727: adapt merge system to rollover (and cleanup too)

* UNOMI-727: adapt merge system to rollover (and cleanup too)

* UNOMI-727: adapt merge system to rollover (and cleanup too)
---
 .../org/apache/unomi/itests/ProfileMergeIT.java| 224 --
 .../actions/MergeProfilesOnPropertyAction.java | 261 ++---
 .../services/impl/segments/SegmentServiceImpl.java |   4 +-
 3 files changed, 322 insertions(+), 167 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/ProfileMergeIT.java 
b/itests/src/test/java/org/apache/unomi/itests/ProfileMergeIT.java
index a5306d9f9..7815baccb 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ProfileMergeIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ProfileMergeIT.java
@@ -16,10 +16,7 @@
  */
 package org.apache.unomi.itests;
 
-import org.apache.unomi.api.Event;
-import org.apache.unomi.api.Metadata;
-import org.apache.unomi.api.Profile;
-import org.apache.unomi.api.ProfileAlias;
+import org.apache.unomi.api.*;
 import org.apache.unomi.api.actions.Action;
 import org.apache.unomi.api.conditions.Condition;
 import org.apache.unomi.api.rules.Rule;
@@ -49,14 +46,15 @@ public class ProfileMergeIT extends BaseIT {
 private final static String TEST_PROFILE_ID = 
"mergeOnPropertyTestProfileId";
 
 @After
-public void after() {
+public void after() throws InterruptedException {
 // cleanup created data
 rulesService.removeRule(TEST_RULE_ID);
+removeItems(Profile.class, ProfileAlias.class, Event.class, 
Session.class);
 }
 
 @Test
 public void 
testProfileMergeOnPropertyAction_dont_forceEventProfileAsMaster() throws 
InterruptedException {
-createAndWaitForRule(createMergeOnPropertyRule(false));
+createAndWaitForRule(createMergeOnPropertyRule(false, "j:nodename"));
 
 // A new profile should be created.
 Assert.assertNotEquals(sendEvent().getProfile().getItemId(), 
TEST_PROFILE_ID);
@@ -64,29 +62,16 @@ public class ProfileMergeIT extends BaseIT {
 
 @Test
 public void testProfileMergeOnPropertyAction_forceEventProfileAsMaster() 
throws InterruptedException {
-createAndWaitForRule(createMergeOnPropertyRule(true));
+createAndWaitForRule(createMergeOnPropertyRule(true, "j:nodename"));
 
 // No new profile should be created, instead the profile of the event 
should be used.
 Assert.assertEquals(sendEvent().getProfile().getItemId(), 
TEST_PROFILE_ID);
 }
 
 @Test
-public void test() throws InterruptedException {
+public void testProfileMergeOnPropertyAction_simpleMergeAndCheckAlias() 
throws InterruptedException {
 // create rule
-Condition condition = new 
Condition(definitionsService.getConditionType("eventTypeCondition"));
-condition.setParameter("eventTypeId", TEST_EVENT_TYPE);
-
-final Action action = new 
Action(definitionsService.getActionType("mergeProfilesOnPropertyAction"));
-action.setParameter("mergeProfilePropertyValue", 
"eventProperty::target.properties(email)");
-action.setParameter("mergeProfilePropertyName", "mergeIdentifier");
-action.setParameter("forceEventProfileAsMaster", false);
-
-Rule rule = new Rule();
-rule.setMetadata(new Metadata(null, TEST_RULE_ID, TEST_RULE_ID, 
"Description"));
-rule.setCondition(condition);
-rule.setActions(Collections.singletonList(action));
-
-createAndWaitForRule(rule);
+createAndWaitForRule(createMergeOnPropertyRule(false, "email"));
 
 // create master profile
 Profile masterProfile = new Profile();
@@ -115,6 +100,14 @@ public class ProfileMergeIT extends BaseIT {
 () -> persistenceService.getAllItems(ProfileAlias.class), 
(profileAliases) -> !profileAliases.isEmpty(),
 DEFAULT_TRYING_TIMEOUT, DEFAULT_TRYING_TRIES);
 
+waitForNullValue("Profile with id eventProfileID not removed in the 
required time",
+() -> persistenceService.load("eventProfileID", Profile.class),
+DEFAULT_TRYING_TIMEOUT, DEFAULT_TRYING_TRIES);
+
+keepTrying("Profile with id eventProfileID should still be accessible 
due to ali

[unomi-site] branch master updated: UNOMI-738 Fix 1.7.x documentation links

2023-03-14 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new 3f187e4  UNOMI-738 Fix 1.7.x documentation links
3f187e4 is described below

commit 3f187e4f6edc34e2891ff9524d2454372d7e0f63
Author: Serge Huber 
AuthorDate: Tue Mar 14 09:22:51 2023 +0100

UNOMI-738 Fix 1.7.x documentation links
---
 src/main/webapp/documentation.html | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/webapp/documentation.html 
b/src/main/webapp/documentation.html
index 1ed8586..533ab7a 100644
--- a/src/main/webapp/documentation.html
+++ b/src/main/webapp/documentation.html
@@ -66,12 +66,12 @@ layout: default
Archive
   Unomi 1.7.x
   
-https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1.7.x.zip";>html 
(zipped)
-[ https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1.7.x.zip.asc";>PGP
 |
-https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1.7.x.zip.sha512";>SHA512
 ]
-https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1.7.x.pdf";>pdf
-[ https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1.7.x.pdf.asc";>PGP
 |
-https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1.7.x.pdf.sha512";>SHA512
 ]
+https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1_7_x.zip";>html 
(zipped)
+[ https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1_7_x.zip.asc";>PGP
 |
+https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1_7_x.zip.sha512";>SHA512
 ]
+https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1_7_x.pdf";>pdf
+[ https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1_7_x.pdf.asc";>PGP
 |
+https://archive.apache.org/dist/unomi/1.7.0/unomi-manual-1_7_x.pdf.sha512";>SHA512
 ]
   
 
   



[unomi] branch master updated: Update scripts to be able to release snapshots of current documentation

2023-04-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 8935ec6dd Update scripts to be able to release snapshots of current 
documentation
8935ec6dd is described below

commit 8935ec6dd09377bf5fd4b67292039b776f3db37a
Author: Serge Huber 
AuthorDate: Tue Apr 18 11:17:35 2023 +0200

Update scripts to be able to release snapshots of current documentation
---
 generate-site-and-upload.sh | 33 +
 generate-site.sh|  7 +--
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/generate-site-and-upload.sh b/generate-site-and-upload.sh
index debe3563e..ec665b047 100755
--- a/generate-site-and-upload.sh
+++ b/generate-site-and-upload.sh
@@ -19,8 +19,9 @@
 

 if [ $# -ne 4 ]
   then
-echo "Illegal number of arguments supplied. Syntax should be 
generate-site-and-upload.sh X_X_X X.X.X SVNusername SVNpassword "
-echo "Example: ./generate-site-and-upload.sh 2_0_x 2.0.1 user password"
+echo "Illegal number of arguments supplied. Syntax should be 
generate-site-and-upload.sh X_X_X X.X.X SVNusername SVNpassword"
+echo "Where X_X_X is either the release branch name or master"
+echo "Example: ./generate-site-and-upload.sh 2_0_x 2.0.1 user password 
./generate-site.sh master 2.3.0-SNAPSHOT user password for updating the master 
snapshot version"
 exit 1
 fi
 echo Setting up environment...
@@ -45,19 +46,19 @@ echo Committing documentation to Apache SVN...
 mvn scm-publish:publish-scm 
-Dscmpublish.pubScmUrl=scm:svn:https://svn.apache.org/repos/asf/unomi/website/manual
 -Dscmpublish.content=target/staging/manual -Dusername=$SVN_USERNAME 
-Dpassword=$SVN_PASSWORD
 if [ "$LOCAL_BRANCH_NAME" == "master" ]; then
   mvn scm-publish:publish-scm 
-Dscmpublish.pubScmUrl=scm:svn:https://svn.apache.org/repos/asf/unomi/website/unomi-api
 -Dscmpublish.content=target/staging/unomi-api -Dusername=$SVN_USERNAME 
-Dpassword=$SVN_PASSWORD
+else
+  echo "Committing manual to Apache Dist SVN..."
+  pushd manual/target
+  svn co https://dist.apache.org/repos/dist/release/unomi/$VERSION
+  mv unomi-manual-$BRANCH_NAME.pdf $VERSION
+  mv unomi-manual-$BRANCH_NAME.pdf.asc $VERSION
+  mv unomi-manual-$BRANCH_NAME.zip $VERSION
+  mv unomi-manual-$BRANCH_NAME.pdf.sha512 $VERSION
+  mv unomi-manual-$BRANCH_NAME.zip.asc $VERSION
+  mv unomi-manual-$BRANCH_NAME.zip.sha512 $VERSION
+  cd $VERSION
+  svn add unomi-manual*
+  svn commit -m "Update Unomi manual packages for version ${VERSION}"
+  popd
 fi
-
-echo "Committing manual to Apache Dist SVN..."
-pushd manual/target
-svn co https://dist.apache.org/repos/dist/release/unomi/$VERSION
-mv unomi-manual-$BRANCH_NAME.pdf $VERSION
-mv unomi-manual-$BRANCH_NAME.pdf.asc $VERSION
-mv unomi-manual-$BRANCH_NAME.zip $VERSION
-mv unomi-manual-$BRANCH_NAME.pdf.sha512 $VERSION
-mv unomi-manual-$BRANCH_NAME.zip.asc $VERSION
-mv unomi-manual-$BRANCH_NAME.zip.sha512 $VERSION
-cd $VERSION
-svn add unomi-manual*
-svn commit -m "Update Unomi manual packages for version ${VERSION}"
-popd
 echo Documentation generation and upload completed.
diff --git a/generate-site.sh b/generate-site.sh
index 6dcf2fb10..8a3fca8ef 100755
--- a/generate-site.sh
+++ b/generate-site.sh
@@ -20,7 +20,8 @@
 if [ $# -ne 2 ]
   then
 echo "Illegal number of arguments supplied. Syntax should be 
generate-site.sh X_X_X X.X.X"
-echo "Example: ./generate.sh 2_0_x 2.0.1"
+echo "Where X_X_X is either the release branch name or master"
+echo "Example: ./generate-site.sh 2_0_x 2.0.1 or ./generate-site.sh master 
2.3.0-SNAPSHOT for updating the master snapshot version"
 exit 1
 fi
 echo Setting up environment...
@@ -41,7 +42,9 @@ echo Git local branch: ${LOCAL_BRANCH_NAME}
 echo Generating manual for branch ${RELEASE_BRANCH_NAME} and version 
${RELEASE_VERSION}...
 mvn clean
 pushd manual
-mvn -Ddoc.archive=true 
-Ddoc.output.pdf=target/generated-docs/pdf/$RELEASE_BRANCH_NAME 
-Ddoc.output.html=target/generated-docs/html/$RELEASE_BRANCH_NAME 
-Ddoc.version=$RELEASE_BRANCH_NAME -P sign install
+if [ "$RELEASE_BRANCH_NAME" != "master" ]; then
+  mvn -Ddoc.archive=true 
-Ddoc.output.pdf=target/generated-docs/pdf/$RELEASE_BRANCH_NAME 
-Ddoc.output.html=target/generated-docs/html/$RELEASE_BRANCH_NAME 
-Ddoc.version=$RELEASE_BRANCH_NAME -P sign install
+fi
 mvn -P sign install
 # If not on master branch we remove the latest directories
 if [ "$LOCAL_BRANCH_NAME" != "master" ]; then



[unomi] branch master updated: [maven-release-plugin] prepare for next development iteration

2023-05-15 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 19d30255f [maven-release-plugin] prepare for next development iteration
19d30255f is described below

commit 19d30255f5f7cd8e0a78ca6a65b67518046a04a8
Author: Serge Huber 
AuthorDate: Mon May 15 17:56:34 2023 +

[maven-release-plugin] prepare for next development iteration
---
 api/pom.xml   | 2 +-
 common/pom.xml| 4 ++--
 docker/pom.xml| 2 +-
 extensions/geonames/pom.xml   | 2 +-
 extensions/geonames/rest/pom.xml  | 2 +-
 extensions/geonames/services/pom.xml  | 2 +-
 extensions/groovy-actions/karaf-kar/pom.xml   | 2 +-
 extensions/groovy-actions/pom.xml | 2 +-
 extensions/groovy-actions/rest/pom.xml| 2 +-
 extensions/groovy-actions/services/pom.xml| 2 +-
 extensions/json-schema/pom.xml| 2 +-
 extensions/json-schema/rest/pom.xml   | 2 +-
 extensions/json-schema/services/pom.xml   | 2 +-
 extensions/lists-extension/actions/pom.xml| 2 +-
 extensions/lists-extension/pom.xml| 2 +-
 extensions/lists-extension/rest/pom.xml   | 2 +-
 extensions/lists-extension/services/pom.xml   | 2 +-
 extensions/pom.xml| 2 +-
 extensions/privacy-extension/pom.xml  | 2 +-
 extensions/privacy-extension/rest/pom.xml | 2 +-
 extensions/privacy-extension/services/pom.xml | 4 ++--
 extensions/router/pom.xml | 2 +-
 extensions/router/router-api/pom.xml  | 2 +-
 extensions/router/router-core/pom.xml | 2 +-
 extensions/router/router-karaf-feature/pom.xml| 2 +-
 extensions/router/router-rest/pom.xml | 2 +-
 extensions/router/router-service/pom.xml  | 2 +-
 extensions/salesforce-connector/actions/pom.xml   | 2 +-
 extensions/salesforce-connector/karaf-kar/pom.xml | 2 +-
 extensions/salesforce-connector/pom.xml   | 2 +-
 extensions/salesforce-connector/rest/pom.xml  | 2 +-
 extensions/salesforce-connector/services/pom.xml  | 2 +-
 extensions/unomi-mailchimp/actions/pom.xml| 2 +-
 extensions/unomi-mailchimp/karaf-kar/pom.xml  | 2 +-
 extensions/unomi-mailchimp/pom.xml| 2 +-
 extensions/unomi-mailchimp/rest/pom.xml   | 2 +-
 extensions/unomi-mailchimp/services/pom.xml   | 2 +-
 extensions/weather-update/core/pom.xml| 2 +-
 extensions/weather-update/karaf-kar/pom.xml   | 2 +-
 extensions/weather-update/pom.xml | 2 +-
 extensions/web-tracker/pom.xml| 2 +-
 extensions/web-tracker/wab/pom.xml| 2 +-
 graphql/cxs-impl/pom.xml  | 2 +-
 graphql/graphql-playground/pom.xml| 2 +-
 graphql/karaf-feature/pom.xml | 2 +-
 graphql/pom.xml   | 2 +-
 itests/pom.xml| 2 +-
 kar/pom.xml   | 2 +-
 lifecycle-watcher/pom.xml | 2 +-
 manual/pom.xml| 2 +-
 metrics/pom.xml   | 2 +-
 package/pom.xml   | 2 +-
 persistence-elasticsearch/core/pom.xml| 2 +-
 persistence-elasticsearch/pom.xml | 2 +-
 persistence-spi/pom.xml   | 2 +-
 plugins/baseplugin/pom.xml| 2 +-
 plugins/hover-event/pom.xml   | 2 +-
 plugins/kafka-injector/pom.xml| 2 +-
 plugins/mail/pom.xml  | 2 +-
 plugins/optimization-test/pom.xml | 2 +-
 plugins/past-event/pom.xml| 2 +-
 plugins/pom.xml   | 2 +-
 plugins/request/pom.xml   | 2 +-
 plugins/tracked-event/pom.xml | 2 +-
 pom.xml   | 4 ++--
 rest/pom.xml  | 2 +-
 samples/graphql-providers-feature/pom.xml | 2 +-
 samples/graphql-providers/pom.xml | 2 +-
 samples/groovy-actions/pom.xml| 2 +-
 samples/login-integration/pom.xml | 2 +-
 samples/pom.xml   | 2 +-
 samples/trainingplugin/pom.xml| 4 ++--
 samples/tweet-button-plugin/pom.xml   | 2 +-
 scripting/pom.xml | 4 ++--
 services/pom.xml  | 2 +-
 tools/pom.xml | 2 +-
 tools/shell-commands/pom.xml

[unomi] branch master updated: [maven-release-plugin] prepare release unomi-root-2.3.0

2023-05-15 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 721c384c4 [maven-release-plugin] prepare release unomi-root-2.3.0
721c384c4 is described below

commit 721c384c4da46e83e1c77b504bbd1eb3debad2e4
Author: Serge Huber 
AuthorDate: Mon May 15 17:56:26 2023 +

[maven-release-plugin] prepare release unomi-root-2.3.0
---
 api/pom.xml   | 2 +-
 common/pom.xml| 4 ++--
 docker/pom.xml| 2 +-
 extensions/geonames/pom.xml   | 2 +-
 extensions/geonames/rest/pom.xml  | 2 +-
 extensions/geonames/services/pom.xml  | 2 +-
 extensions/groovy-actions/karaf-kar/pom.xml   | 2 +-
 extensions/groovy-actions/pom.xml | 2 +-
 extensions/groovy-actions/rest/pom.xml| 2 +-
 extensions/groovy-actions/services/pom.xml| 2 +-
 extensions/json-schema/pom.xml| 2 +-
 extensions/json-schema/rest/pom.xml   | 2 +-
 extensions/json-schema/services/pom.xml   | 2 +-
 extensions/lists-extension/actions/pom.xml| 2 +-
 extensions/lists-extension/pom.xml| 2 +-
 extensions/lists-extension/rest/pom.xml   | 2 +-
 extensions/lists-extension/services/pom.xml   | 2 +-
 extensions/pom.xml| 2 +-
 extensions/privacy-extension/pom.xml  | 2 +-
 extensions/privacy-extension/rest/pom.xml | 2 +-
 extensions/privacy-extension/services/pom.xml | 4 ++--
 extensions/router/pom.xml | 2 +-
 extensions/router/router-api/pom.xml  | 2 +-
 extensions/router/router-core/pom.xml | 2 +-
 extensions/router/router-karaf-feature/pom.xml| 2 +-
 extensions/router/router-rest/pom.xml | 2 +-
 extensions/router/router-service/pom.xml  | 2 +-
 extensions/salesforce-connector/actions/pom.xml   | 2 +-
 extensions/salesforce-connector/karaf-kar/pom.xml | 2 +-
 extensions/salesforce-connector/pom.xml   | 2 +-
 extensions/salesforce-connector/rest/pom.xml  | 2 +-
 extensions/salesforce-connector/services/pom.xml  | 2 +-
 extensions/unomi-mailchimp/actions/pom.xml| 2 +-
 extensions/unomi-mailchimp/karaf-kar/pom.xml  | 2 +-
 extensions/unomi-mailchimp/pom.xml| 2 +-
 extensions/unomi-mailchimp/rest/pom.xml   | 2 +-
 extensions/unomi-mailchimp/services/pom.xml   | 2 +-
 extensions/weather-update/core/pom.xml| 2 +-
 extensions/weather-update/karaf-kar/pom.xml   | 2 +-
 extensions/weather-update/pom.xml | 2 +-
 extensions/web-tracker/pom.xml| 2 +-
 extensions/web-tracker/wab/pom.xml| 2 +-
 graphql/cxs-impl/pom.xml  | 2 +-
 graphql/graphql-playground/pom.xml| 2 +-
 graphql/karaf-feature/pom.xml | 2 +-
 graphql/pom.xml   | 2 +-
 itests/pom.xml| 2 +-
 kar/pom.xml   | 2 +-
 lifecycle-watcher/pom.xml | 2 +-
 manual/pom.xml| 2 +-
 metrics/pom.xml   | 2 +-
 package/pom.xml   | 2 +-
 persistence-elasticsearch/core/pom.xml| 2 +-
 persistence-elasticsearch/pom.xml | 2 +-
 persistence-spi/pom.xml   | 2 +-
 plugins/baseplugin/pom.xml| 2 +-
 plugins/hover-event/pom.xml   | 2 +-
 plugins/kafka-injector/pom.xml| 2 +-
 plugins/mail/pom.xml  | 2 +-
 plugins/optimization-test/pom.xml | 2 +-
 plugins/past-event/pom.xml| 2 +-
 plugins/pom.xml   | 2 +-
 plugins/request/pom.xml   | 2 +-
 plugins/tracked-event/pom.xml | 2 +-
 pom.xml   | 4 ++--
 rest/pom.xml  | 2 +-
 samples/graphql-providers-feature/pom.xml | 2 +-
 samples/graphql-providers/pom.xml | 2 +-
 samples/groovy-actions/pom.xml| 2 +-
 samples/login-integration/pom.xml | 2 +-
 samples/pom.xml   | 2 +-
 samples/trainingplugin/pom.xml| 4 ++--
 samples/tweet-button-plugin/pom.xml   | 2 +-
 scripting/pom.xml | 4 ++--
 services/pom.xml  | 2 +-
 tools/pom.xml | 2 +-
 tools/shell-commands/pom.xml  | 2

[unomi] annotated tag unomi-root-2.3.0 created (now 72e4bd709)

2023-05-15 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to annotated tag unomi-root-2.3.0
in repository https://gitbox.apache.org/repos/asf/unomi.git


  at 72e4bd709 (tag)
 tagging 721c384c4da46e83e1c77b504bbd1eb3debad2e4 (commit)
 replaces unomi-root-2.2.0
  by Serge Huber
  on Mon May 15 17:56:30 2023 +

- Log -
[maven-release-plugin] copy for tag unomi-root-2.3.0
---

No new revisions were added by this update.



[unomi-site] branch master updated: Apache Unomi 2.3.0 Release website update

2023-05-22 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new 161e0a4  Apache Unomi 2.3.0 Release website update
161e0a4 is described below

commit 161e0a4e10857f1b67d183ed25becaf2a2e9f6b8
Author: Serge Huber 
AuthorDate: Mon May 22 15:47:12 2023 +0200

Apache Unomi 2.3.0 Release website update
---
 pom.xml| 12 +-
 src/main/webapp/documentation.html | 32 ++---
 src/main/webapp/download.html  | 49 +-
 src/main/webapp/index.html | 21 
 4 files changed, 89 insertions(+), 25 deletions(-)

diff --git a/pom.xml b/pom.xml
index 15d06d1..79e72e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,12 +46,12 @@
 
 
 
-2.2.0
-2.3.0
-2.3.0-SNAPSHOT
-2.3.0-SNAPSHOT
-2.2.x
-2_2_x
+2.3.0
+2.4.0
+2.4.0-SNAPSHOT
+2.4.0-SNAPSHOT
+2.3.x
+2_3_x
 
 
 
diff --git a/src/main/webapp/documentation.html 
b/src/main/webapp/documentation.html
index 95513a7..1aa727a 100644
--- a/src/main/webapp/documentation.html
+++ b/src/main/webapp/documentation.html
@@ -13,15 +13,15 @@ layout: default
   
 
Stable
-  Unomi 2.2.x
+  Unomi 2.3.x
   
-online
-https://dist.apache.org/repos/dist/release/unomi/2.2.0/unomi-manual-2_2_x.zip";>html
 (zipped)
-[ https://dist.apache.org/repos/dist/release/unomi/2.2.0/unomi-manual-2_2_x.zip.asc";>PGP
 |
-https://dist.apache.org/repos/dist/release/unomi/2.2.0/unomi-manual-2_2_x.zip.sha512";>SHA512
 ]
-https://dist.apache.org/repos/dist/release/unomi/2.2.0/unomi-manual-2_2_x.pdf";>pdf
-[ https://dist.apache.org/repos/dist/release/unomi/2.2.0/unomi-manual-2_2_x.pdf.asc";>PGP
 |
-https://dist.apache.org/repos/dist/release/unomi/2.2.0/unomi-manual-2_2_x.pdf.sha512";>SHA512
 ]
+online
+https://dist.apache.org/repos/dist/release/unomi/2.3.0/unomi-manual-2_3_x.zip";>html
 (zipped)
+[ https://dist.apache.org/repos/dist/release/unomi/2.3.0/unomi-manual-2_3_x.zip.asc";>PGP
 |
+https://dist.apache.org/repos/dist/release/unomi/2.3.0/unomi-manual-2_3_x.zip.sha512";>SHA512
 ]
+https://dist.apache.org/repos/dist/release/unomi/2.3.0/unomi-manual-2_3_x.pdf";>pdf
+[ https://dist.apache.org/repos/dist/release/unomi/2.3.0/unomi-manual-2_3_x.pdf.asc";>PGP
 |
+https://dist.apache.org/repos/dist/release/unomi/2.3.0/unomi-manual-2_3_x.pdf.sha512";>SHA512
 ]
 -->
   
 
@@ -44,6 +44,22 @@ layout: default
   Archives
 
   
+
+  
+
+   Archive
+  Unomi 2.2.x
+  
+https://archive.apache.org/dist/unomi/2.2.0/unomi-manual-2_2_x.zip";>html 
(zipped)
+[ https://archive.apache.org/dist/unomi/2.2.0/unomi-manual-2_2_x.zip.asc";>PGP
 |
+https://archive.apache.org/dist/unomi/2.2.0/unomi-manual-2_2_x.zip.sha512";>SHA512
 ]
+https://archive.apache.org/dist/unomi/2.2.0/unomi-manual-2_2_x.pdf";>pdf
+[ https://archive.apache.org/dist/unomi/2.2.0/unomi-manual-2_2_x.pdf.asc";>PGP
 |
+https://archive.apache.org/dist/unomi/2.2.0/unomi-manual-2_2_x.pdf.sha512";>SHA512
 ]
+  
+
+  
+
 
   
 
diff --git a/src/main/webapp/download.html b/src/main/webapp/download.html
index 1ba5c6e..d32ea46 100644
--- a/src/main/webapp/download.html
+++ b/src/main/webapp/download.html
@@ -11,24 +11,24 @@ layout: default
   
 
Latest release
-  Unomi 2.2.0
+  Unomi 2.3.0
   April 4th, 2023
   
 Binary Distribution :
-  https://www.apache.org/dyn/closer.lua/unomi/2.2.0/unomi-2.2.0-bin.tar.gz";>tar.gz
-  [https://www.apache.org/dist/unomi/2.2.0/unomi-2.2.0-bin.tar.gz.asc";>PGP]
-  [https://www.apache.org/dist/unomi/2.2.0/unomi-2.2.0-bin.tar.gz.sha512";>SHA512]
 -
-  https://www.apache.org/dyn/closer.lua/unomi/2.2.0/unomi-2.2.0-bin.zip";>zip
-  [https://www.apache.org/dist/unomi/2.2.0/unomi-2.2.0-bin.zip.asc";>PGP]
-  [https://www.apache.org/dist/unomi/2.2.0/unomi-2.2.0-bin.zip.sha512";>SHA512]
+  https:

[unomi] branch UNOMI-797-migration-doc-fixes created (now 684f0ff91)

2023-08-31 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-797-migration-doc-fixes
in repository https://gitbox.apache.org/repos/asf/unomi.git


  at 684f0ff91 UNOMI-797 Fixes in migration documentation

This branch includes the following new commits:

 new 684f0ff91 UNOMI-797 Fixes in migration documentation

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[unomi] 01/01: UNOMI-797 Fixes in migration documentation

2023-08-31 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-797-migration-doc-fixes
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 684f0ff91cf7f594c0f44f592f9cafaa6cb52dad
Author: Serge Huber 
AuthorDate: Thu Aug 31 17:41:11 2023 +0200

UNOMI-797 Fixes in migration documentation
---
 .../asciidoc/migrations/migrate-1.6-to-2.0.adoc| 48 +++---
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc 
b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
index 15133a229..58faf1242 100644
--- a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
+++ b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
@@ -22,58 +22,58 @@ There are two main steps in preparing your migration to 
Apache Unomi 2.0:
 
 === Updating applications consuming Unomi
 
-Since Apache Unomi is an engine, you've probably built multiple applications 
consuming its APIs, you might also have built extensions directly running in 
Unomi. 
+Since Apache Unomi is an engine, you've probably built multiple applications 
consuming its APIs, you might also have built extensions directly running in 
Unomi.
 
-As you begin updating applications consuming Apache Unomi, it is generally a 
good practice to <>. 
+As you begin updating applications consuming Apache Unomi, it is generally a 
good practice to <<_enabling_debug_mode,enable debug mode>>.
 Doing so will display any errors when processing events (such as JSON Schema 
validations), and will provide useful indications towards solving issues.
 
  Data Model changes
 
-There has been changes to Unomi Data model, please make sure to review those 
in the << what_s_new>> section of the user manual.
+There has been changes to Unomi Data model, please make sure to review those 
in the <<_whats_new_in_apache_unomi_2_0,What's new in Unomi 2>> section of the 
user manual.
 
  Create JSON schemas
 
 Once you updated your applications to align with Unomi 2 data model, the next 
step will be to create the necessary JSON Schemas.
 
-Any event (and more generally, any object) received through Unomi public 
endpoints do require a valid JSON schema. 
-Apache Unomi ships, out of the box, with all of the necessary JSON Schemas for 
its own operation but you will need to create schemas for any custom event you 
may be using.
+Any event (and more generally, any object) received through Unomi public 
endpoints do require a valid JSON schema.
+Apache Unomi ships, out of the box, with all of the necessary JSON Schemas for 
its own operation as well as all event types generated from the Apache Unomi 
Web Tracker but you will need to create schemas for any custom event you may be 
using.
 
-When creating your new schemas, reviewing debug messages in the logs (using: 
`log:set DEBUG org.apache.unomi.schema.impl.SchemaServiceImpl` in Karaf 
console), 
-will point to errors in your schemas or will help you diagnose why the events 
are not being accepted.
+When creating your new schemas, you can setup debug messages in the logs 
(using: `log:set DEBUG org.apache.unomi.schema.impl.SchemaServiceImpl` in Karaf 
console) that
+will point to errors in your schemas or will help you diagnose why the events 
are not being accepted. It is also possible to use the 
UNOMI_LOGS_JSONSCHEMA_LEVEL environment variable (by setting it to the `DEBUG` 
value) and then restarting Apache Unomi to accomplish the same thing. The 
second option is especially useful when using Docker containers. It is also 
possible to test if your events are valid with the a new API endpoint mapped at 
`/cxs/jsonSchema/validateEvent`.
 
 Note that it is currently not possible to modify or surcharge an existing 
system-deployed JSON schema via the REST API. It is however possible to deploy 
new schemas and manage them through the REST API on the `/cxs/jsonSchema` 
endpoint.
-If you are currently using custom properties on an Apache Unomi-provided event 
type, 
+If you are currently using custom properties on an Apache Unomi-provided event 
type,
 you will need to either change to use a new custom eventType and create the 
corresponding schema or to create a Unomi schema extension. You can find more 
details in the <> section of this documentation.
 
-You can use, as a source of inspiration for creating new schemas, Apache Unomi 
2.0 schema located at: 
+You can use, as a source of inspiration for creating new schemas, Apache Unomi 
2.0 schema located at:
  
https://github.com/apache/unomi/tree/master/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas[extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas].
 
-Finally, and although it is technically feasible, we recommend against 
creating permissive JSON Schemas allowing any event payload. This requires 
making sure that you don

[unomi] branch UNOMI-797-migration-doc-fixes updated: UNOMI-797 Fixes in migration documentation - Simplified the text further based on the review.

2023-09-01 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-797-migration-doc-fixes
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/UNOMI-797-migration-doc-fixes 
by this push:
 new dac800fe9 UNOMI-797 Fixes in migration documentation - Simplified the 
text further based on the review.
dac800fe9 is described below

commit dac800fe9d9de4f8bc5f1bb41302e8f05980aa80
Author: Serge Huber 
AuthorDate: Fri Sep 1 09:58:07 2023 +0200

UNOMI-797 Fixes in migration documentation
- Simplified the text further based on the review.
---
 .../main/asciidoc/migrations/migrate-1.6-to-2.0.adoc| 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc 
b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
index 58faf1242..65ee4af4a 100644
--- a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
+++ b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
@@ -38,8 +38,19 @@ Once you updated your applications to align with Unomi 2 
data model, the next st
 Any event (and more generally, any object) received through Unomi public 
endpoints do require a valid JSON schema.
 Apache Unomi ships, out of the box, with all of the necessary JSON Schemas for 
its own operation as well as all event types generated from the Apache Unomi 
Web Tracker but you will need to create schemas for any custom event you may be 
using.
 
-When creating your new schemas, you can setup debug messages in the logs 
(using: `log:set DEBUG org.apache.unomi.schema.impl.SchemaServiceImpl` in Karaf 
console) that
-will point to errors in your schemas or will help you diagnose why the events 
are not being accepted. It is also possible to use the 
UNOMI_LOGS_JSONSCHEMA_LEVEL environment variable (by setting it to the `DEBUG` 
value) and then restarting Apache Unomi to accomplish the same thing. The 
second option is especially useful when using Docker containers. It is also 
possible to test if your events are valid with the a new API endpoint mapped at 
`/cxs/jsonSchema/validateEvent`.
+When creating your new schemas, there are multiple ways of testing them:
+
+- Using a the event validation API endpoint mapped at : 
`/cxs/jsonSchema/validateEvent`
+- Using debug logs when sending events using the usual ways (using the 
`/context.json` or `/eventcollector` endpoints)
+
+Note that in both cases it helps to activate the debug logs.
+
+To active the debug logs you can activate them in two ways:
+
+- Through the ssh Karaf console command : `log:set DEBUG 
org.apache.unomi.schema.impl.SchemaServiceImpl`
+- Using the UNOMI_LOGS_JSONSCHEMA_LEVEL=DEBUG environment variable and then 
restarting Apache Unomi. This is especially useful when using Docker Containers.
+
+Once the debug logs are active, you will see detailed error messages if your 
events are not matched with any deployed JSON schema.
 
 Note that it is currently not possible to modify or surcharge an existing 
system-deployed JSON schema via the REST API. It is however possible to deploy 
new schemas and manage them through the REST API on the `/cxs/jsonSchema` 
endpoint.
 If you are currently using custom properties on an Apache Unomi-provided event 
type,
@@ -58,7 +69,7 @@ While still using Unomi 1.6, the first step will be to 
upgrade your Elasticsearc
 Documentation is available on 
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/setup-upgrade.html[Elasticsearch's
 website].
 
 Your Elasticsearch cluster must have enough capacity to handle the migration.
-At a minimum, the required capacity storage capacity must be greater than the 
size of the dataset in production + the size of the largest index and any other 
settings should at least be as big as the source setup (preferably higher).
+At a minimum, the required capacity storage capacity must be greater than the 
size of the dataset in production + the size of the largest index. Any other 
settings should at least be as big as the source setup (preferably higher).
 
  Migrate custom data
 



[unomi] branch UNOMI-797-migration-doc-fixes updated: UNOMI-797 Fixes in migration documentation - Minor text improvements.

2023-09-01 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-797-migration-doc-fixes
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/UNOMI-797-migration-doc-fixes 
by this push:
 new 96219de8a UNOMI-797 Fixes in migration documentation - Minor text 
improvements.
96219de8a is described below

commit 96219de8a69560d8049a50aa163a79498f1c3445
Author: Serge Huber 
AuthorDate: Fri Sep 1 10:55:31 2023 +0200

UNOMI-797 Fixes in migration documentation
- Minor text improvements.
---
 manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc 
b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
index 65ee4af4a..b175f0e64 100644
--- a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
+++ b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
@@ -40,12 +40,10 @@ Apache Unomi ships, out of the box, with all of the 
necessary JSON Schemas for i
 
 When creating your new schemas, there are multiple ways of testing them:
 
-- Using a the event validation API endpoint mapped at : 
`/cxs/jsonSchema/validateEvent`
+- Using a the event validation API endpoint available at the URL : 
`/cxs/jsonSchema/validateEvent`
 - Using debug logs when sending events using the usual ways (using the 
`/context.json` or `/eventcollector` endpoints)
 
-Note that in both cases it helps to activate the debug logs.
-
-To active the debug logs you can activate them in two ways:
+Note that in both cases it helps to activate the debug logs, that may be 
activated either:
 
 - Through the ssh Karaf console command : `log:set DEBUG 
org.apache.unomi.schema.impl.SchemaServiceImpl`
 - Using the UNOMI_LOGS_JSONSCHEMA_LEVEL=DEBUG environment variable and then 
restarting Apache Unomi. This is especially useful when using Docker Containers.



[unomi] branch master updated: UNOMI-797 Fixes in migration documentation (#647)

2023-09-01 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 98e4d87c8 UNOMI-797 Fixes in migration documentation (#647)
98e4d87c8 is described below

commit 98e4d87c827b05e817e0538793a8a34e5434a00a
Author: Serge Huber 
AuthorDate: Fri Sep 1 12:31:54 2023 +0200

UNOMI-797 Fixes in migration documentation (#647)

* UNOMI-797 Fixes in migration documentation

* UNOMI-797 Fixes in migration documentation
- Simplified the text further based on the review.

* UNOMI-797 Fixes in migration documentation
- Minor text improvements.
---
 .../asciidoc/migrations/migrate-1.6-to-2.0.adoc| 57 +-
 1 file changed, 33 insertions(+), 24 deletions(-)

diff --git a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc 
b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
index 15133a229..b175f0e64 100644
--- a/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
+++ b/manual/src/main/asciidoc/migrations/migrate-1.6-to-2.0.adoc
@@ -22,58 +22,67 @@ There are two main steps in preparing your migration to 
Apache Unomi 2.0:
 
 === Updating applications consuming Unomi
 
-Since Apache Unomi is an engine, you've probably built multiple applications 
consuming its APIs, you might also have built extensions directly running in 
Unomi. 
+Since Apache Unomi is an engine, you've probably built multiple applications 
consuming its APIs, you might also have built extensions directly running in 
Unomi.
 
-As you begin updating applications consuming Apache Unomi, it is generally a 
good practice to <>. 
+As you begin updating applications consuming Apache Unomi, it is generally a 
good practice to <<_enabling_debug_mode,enable debug mode>>.
 Doing so will display any errors when processing events (such as JSON Schema 
validations), and will provide useful indications towards solving issues.
 
  Data Model changes
 
-There has been changes to Unomi Data model, please make sure to review those 
in the << what_s_new>> section of the user manual.
+There has been changes to Unomi Data model, please make sure to review those 
in the <<_whats_new_in_apache_unomi_2_0,What's new in Unomi 2>> section of the 
user manual.
 
  Create JSON schemas
 
 Once you updated your applications to align with Unomi 2 data model, the next 
step will be to create the necessary JSON Schemas.
 
-Any event (and more generally, any object) received through Unomi public 
endpoints do require a valid JSON schema. 
-Apache Unomi ships, out of the box, with all of the necessary JSON Schemas for 
its own operation but you will need to create schemas for any custom event you 
may be using.
+Any event (and more generally, any object) received through Unomi public 
endpoints do require a valid JSON schema.
+Apache Unomi ships, out of the box, with all of the necessary JSON Schemas for 
its own operation as well as all event types generated from the Apache Unomi 
Web Tracker but you will need to create schemas for any custom event you may be 
using.
 
-When creating your new schemas, reviewing debug messages in the logs (using: 
`log:set DEBUG org.apache.unomi.schema.impl.SchemaServiceImpl` in Karaf 
console), 
-will point to errors in your schemas or will help you diagnose why the events 
are not being accepted.
+When creating your new schemas, there are multiple ways of testing them:
+
+- Using a the event validation API endpoint available at the URL : 
`/cxs/jsonSchema/validateEvent`
+- Using debug logs when sending events using the usual ways (using the 
`/context.json` or `/eventcollector` endpoints)
+
+Note that in both cases it helps to activate the debug logs, that may be 
activated either:
+
+- Through the ssh Karaf console command : `log:set DEBUG 
org.apache.unomi.schema.impl.SchemaServiceImpl`
+- Using the UNOMI_LOGS_JSONSCHEMA_LEVEL=DEBUG environment variable and then 
restarting Apache Unomi. This is especially useful when using Docker Containers.
+
+Once the debug logs are active, you will see detailed error messages if your 
events are not matched with any deployed JSON schema.
 
 Note that it is currently not possible to modify or surcharge an existing 
system-deployed JSON schema via the REST API. It is however possible to deploy 
new schemas and manage them through the REST API on the `/cxs/jsonSchema` 
endpoint.
-If you are currently using custom properties on an Apache Unomi-provided event 
type, 
+If you are currently using custom properties on an Apache Unomi-provided event 
type,
 you will need to either change to use a new custom eventType and create the 
corresponding schema or to create a Unomi schema extension. You can find more 
details in the <> section of this documentation.
 
-You can use, as a source of

[unomi] branch UNOMI-797-migration-doc-fixes deleted (was 96219de8a)

2023-09-01 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-797-migration-doc-fixes
in repository https://gitbox.apache.org/repos/asf/unomi.git


 was 96219de8a UNOMI-797 Fixes in migration documentation - Minor text 
improvements.

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(unomi) branch master updated: UNOMI-576 : Create documentation for GraphQL schema usage (#653)

2024-02-15 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 110286ad7 UNOMI-576 : Create documentation for GraphQL schema usage 
(#653)
110286ad7 is described below

commit 110286ad74ecaec927f3b61c54140d852dfbd4fe
Author: Pavel Milkevich 
AuthorDate: Thu Feb 15 10:20:23 2024 +0100

UNOMI-576 : Create documentation for GraphQL schema usage (#653)
---
 manual/src/main/asciidoc/graphql-examples.adoc | 253 +
 manual/src/main/asciidoc/index.adoc|   2 +
 2 files changed, 255 insertions(+)

diff --git a/manual/src/main/asciidoc/graphql-examples.adoc 
b/manual/src/main/asciidoc/graphql-examples.adoc
new file mode 100644
index 0..b4602288e
--- /dev/null
+++ b/manual/src/main/asciidoc/graphql-examples.adoc
@@ -0,0 +1,253 @@
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+=== Graphql request examples
+
+You can use embedded GraphiQL interface available at 
http://localhost:8181/graphql-ui or use any other GraphQL client using that url 
for requests.
+
+ Retrieving your first profile
+
+Profile can be retrieved using `getProfile` query
+
+[source,graphql]
+
+query($profileID: CDP_ProfileIDInput!, $createIfMissing: Boolean) {
+  cdp {
+getProfile(profileID: $profileID, createIfMissing: $createIfMissing) {
+  firstName
+  lastName
+  gender
+  cdp_profileIDs {
+client {
+  ID
+  title
+}
+id
+  }
+}
+  }
+}
+
+
+This query accepts two variables that need to be provided in the `Query 
variables` section:
+
+[source,json]
+
+{
+  "profileID": {
+"client":{
+  "id": "defaultClientId"
+},
+"id": 1001
+  },
+  "createIfMissing": true
+}
+
+
+NOTE: If you don't want profile to be created if missing, set 
`createIfMissing` to `false`.
+
+The response will look like this:
+
+[source,json]
+
+{
+  "data": {
+"cdp": {
+  "getProfile": {
+"firstName": null,
+"lastName": null,
+"gender": null,
+"cdp_profileIDs": [
+  {
+"client": {
+  "ID": "defaultClientId",
+  "title": "Default Client"
+},
+"id": "1001"
+  }
+]
+  }
+}
+  }
+}
+
+
+ Updating profile
+
+Now let's update our profile with some data.
+It can be done using `processEvents` mutation:
+
+[source,graphql]
+
+mutation($events: [CDP_EventInput]!) {
+  cdp {
+processEvents(events: $events)
+  }
+}
+
+
+This mutation accepts one variable that needs to be provided in the `Query 
variables` section:
+
+[source,json]
+
+{
+  "events": [
+{
+  "cdp_objectID": 1001,
+  "cdp_profileID": {
+"client": {
+  "id": "defaultClientId"
+},
+"id": 1001
+  },
+  "cdp_profileUpdateEvent": {
+"firstName": "John",
+"lastName": "Doe",
+"gender": "Male"
+  }
+}
+  ]
+}
+
+
+The response will have the number of processed events:
+
+[source,json]
+
+{
+  "data": {
+"cdp": {
+  "processEvents": 1
+}
+  }
+}
+
+
+NOTE: `processEvents` accepts a number of other event types that are listed on 
`CDP_EventInput` type.
+
+If you run the `getProfile` query again, you will see that the profile has 
been updated.
+
+ Restricted methods
+
+Some methods are restricted to authenticated users only.
+One example is `findProfiles` query:
+
+[source,graphql]
+
+query {
+  cdp {
+findProfiles {
+  totalCount
+   edges {
+node {
+  cdp_profileIDs {
+client{
+  title
+  ID
+}
+id
+  }
+}
+  }
+}
+  }
+}
+
+
+And if you run it now, you will get an error.
+
+To make this query work you need to supply authorization token in the `HTTP 
headers` section:
+
+[source,json]
+
+{
+  &q

(unomi-site) 01/01: Merge pull request #32 from Lugigikas/unomi-stories-dropsolid

2024-06-07 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git

commit 6e0e8c1076008f5c59c67a6cb009197fc6d7c5ef
Merge: 9186971 f0ab621
Author: Serge Huber 
AuthorDate: Fri Jun 7 17:33:26 2024 +0200

Merge pull request #32 from Lugigikas/unomi-stories-dropsolid

Small update for Dropsolid's Unomi story.

 src/main/webapp/stories.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



(unomi-site) branch master updated (9186971 -> 6e0e8c1)

2024-06-07 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


from 9186971  Apache Unomi 2.4.0 Release website update (update links in 
documentation page) (fix)
 add b21f9f2  Small update for Dropsolid's Unomi story.
 add 33adb62  Put the trailing spaces back
 add 7d701d1  Add newline at end of file back.
 add f0ab621  Add 2nd newline at end of file back.
 new 6e0e8c1  Merge pull request #32 from Lugigikas/unomi-stories-dropsolid

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/webapp/stories.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



(unomi-site) branch UNOMI-843 created (now 1e29397)

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-843
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


  at 1e29397  UNOMI-843 Various website fixes & improvements - Fixed Google 
Analytics script - Added information about the monthly meeting - Replaced HTTP 
links with HTTPS - Fixed minor issue in README due to hidden character - Fixed 
YouTube videos by replacing embedding with buttons (the problem is due to 
changes in the Apache HTTPD server configuration that no longer allows 
embedding) - Fixed other minor HTML issues

This branch includes the following new commits:

 new 1e29397  UNOMI-843 Various website fixes & improvements - Fixed Google 
Analytics script - Added information about the monthly meeting - Replaced HTTP 
links with HTTPS - Fixed minor issue in README due to hidden character - Fixed 
YouTube videos by replacing embedding with buttons (the problem is due to 
changes in the Apache HTTPD server configuration that no longer allows 
embedding) - Fixed other minor HTML issues

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(unomi-site) 01/01: UNOMI-843 Various website fixes & improvements - Fixed Google Analytics script - Added information about the monthly meeting - Replaced HTTP links with HTTPS - Fixed minor issue in

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-843
in repository https://gitbox.apache.org/repos/asf/unomi-site.git

commit 1e293978fdf09ea4207db77af12304782b06e10d
Author: Serge Huber 
AuthorDate: Tue Aug 27 09:58:35 2024 +0200

UNOMI-843 Various website fixes & improvements
- Fixed Google Analytics script
- Added information about the monthly meeting
- Replaced HTTP links with HTTPS
- Fixed minor issue in README due to hidden character
- Fixed YouTube videos by replacing embedding with buttons (the problem is 
due to changes in the Apache HTTPD server configuration that no longer allows 
embedding)
- Fixed other minor HTML issues
---
 README.md |  4 ++--
 src/main/webapp/_layouts/default.html | 12 ++--
 src/main/webapp/community/index.html  |  6 ++
 src/main/webapp/index.html| 14 ++
 src/main/webapp/resources.html| 26 +++---
 5 files changed, 23 insertions(+), 39 deletions(-)

diff --git a/README.md b/README.md
index 0770ec3..a5d99e3 100644
--- a/README.md
+++ b/README.md
@@ -59,8 +59,8 @@ Run the following command
 docker run --rm \
   --volume="$PWD:/srv/jekyll:Z" \
   -p 4000:4000 \
-  jekyll/jekyll:4.2.0 \ 
+  jekyll/jekyll:4.2.0 \
   jekyll serve 
 ```
 
-Then access to http://localhost:4000/ to access the site. Note that source 
changes are detected and apply automatically.
\ No newline at end of file
+Then access to http://localhost:4000/ to access the site. Note that source 
changes are detected and apply automatically.
diff --git a/src/main/webapp/_layouts/default.html 
b/src/main/webapp/_layouts/default.html
index de42fd1..9804c17 100644
--- a/src/main/webapp/_layouts/default.html
+++ b/src/main/webapp/_layouts/default.html
@@ -10,14 +10,14 @@
 {{ site.title }} | {{ page.title }}
 
 
+
+https://www.googletagmanager.com/gtag/js?id=G-4LJ70BXZR2"</a>;>
 
-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-
})(window,document,'script','<a  rel="nofollow" href="https://www.google-analytics.com/analytics.js">https://www.google-analytics.com/analytics.js</a>','ga');
+window.dataLayer = window.dataLayer || [];
+function gtag(){dataLayer.push(arguments);}
+gtag('js', new Date());
 
-ga('create', 'UA-70313240-1', 'auto');
-ga('send', 'pageview');
+gtag('config', 'G-4LJ70BXZR2');
 
 
 
diff --git a/src/main/webapp/community/index.html 
b/src/main/webapp/community/index.html
index 1cbcea2..2aa3a4d 100644
--- a/src/main/webapp/community/index.html
+++ b/src/main/webapp/community/index.html
@@ -27,6 +27,12 @@ layout: default
   
 
 
+  
+https://lists.apache.org/thread/70oo862br3d4g7j8dvnyy3o4z1p0ozfq";>Monthly 
meeting
+The Apache Unomi meets monthly online, with alternating 
times to accomodate most time zones. Current
+  status and future work is usually discussed but anyone is 
welcome !
+
+  
   
 https://lists.apache.org/list.html?us...@unomi.apache.org";>users@ 
mailing list
 Users discussions (mailto:users-subscr...@unomi.apache.org";>Subscribe, mailto:users-unsubscr...@unomi.apache.org";>Unsubscribe)
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index 3ba7be6..4645026 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -66,9 +66,9 @@ layout: default
 
 [UNOMI-822] - 
Add search event
 
-[UNOMI-825] - 
Hide some profile properties from context request when requirered is set to 
with all (*)
+[UNOMI-825] - 
Hide some profile properties from context request when required is set to with 
all (*)
 
-[UNOMI-827] - 
Relase Unomi-tracker 1.4.0
+[UNOMI-827] - 
Release Unomi-tracker 1.4.0
 
 [UNOMI-829] - 
Upgrade the dependencies version
 
@@ -177,7 +177,7 @@ layout: default
 Version 1.9.0 released!
 Changes in 1.9.0 (since 1.8.0)
 
-Oneshot profiles export improved and faster
+One-shot profiles export improved and faster
 Segment recalculation job scheduling fixed
 Profile merge syste

(unomi-site) branch UNOMI-843 deleted (was 1e29397)

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-843
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


 was 1e29397  UNOMI-843 Various website fixes & improvements - Fixed Google 
Analytics script - Added information about the monthly meeting - Replaced HTTP 
links with HTTPS - Fixed minor issue in README due to hidden character - Fixed 
YouTube videos by replacing embedding with buttons (the problem is due to 
changes in the Apache HTTPD server configuration that no longer allows 
embedding) - Fixed other minor HTML issues

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(unomi-site) 01/01: Merge pull request #33 from apache/UNOMI-843

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git

commit 324e265047751975d55f921db085fb9f6237ec82
Merge: f7fe436 1e29397
Author: Serge Huber 
AuthorDate: Tue Aug 27 10:13:36 2024 +0200

Merge pull request #33 from apache/UNOMI-843

UNOMI-843 Various website fixes & improvements

 README.md |  4 ++--
 src/main/webapp/_layouts/default.html | 12 ++--
 src/main/webapp/community/index.html  |  6 ++
 src/main/webapp/index.html| 14 ++
 src/main/webapp/resources.html| 26 +++---
 5 files changed, 23 insertions(+), 39 deletions(-)



(unomi-site) branch master updated (f7fe436 -> 324e265)

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


from f7fe436  UNOMI-840 : update documentation for release 2.5.0
 add 1e29397  UNOMI-843 Various website fixes & improvements - Fixed Google 
Analytics script - Added information about the monthly meeting - Replaced HTTP 
links with HTTPS - Fixed minor issue in README due to hidden character - Fixed 
YouTube videos by replacing embedding with buttons (the problem is due to 
changes in the Apache HTTPD server configuration that no longer allows 
embedding) - Fixed other minor HTML issues
 new 324e265  Merge pull request #33 from apache/UNOMI-843

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md |  4 ++--
 src/main/webapp/_layouts/default.html | 12 ++--
 src/main/webapp/community/index.html  |  6 ++
 src/main/webapp/index.html| 14 ++
 src/main/webapp/resources.html| 26 +++---
 5 files changed, 23 insertions(+), 39 deletions(-)



(unomi-site) 01/01: UNOMI-XXX Add Inoyu.dev to commercial support

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-848
in repository https://gitbox.apache.org/repos/asf/unomi-site.git

commit 4fa369f2f8c0fa000522530ed7f07f0f8b24674a
Author: Serge Huber 
AuthorDate: Tue Aug 27 11:29:55 2024 +0200

UNOMI-XXX Add Inoyu.dev to commercial support
---
 src/main/webapp/stories.html | 26 +++---
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/main/webapp/stories.html b/src/main/webapp/stories.html
index 5d35e9c..554341f 100644
--- a/src/main/webapp/stories.html
+++ b/src/main/webapp/stories.html
@@ -51,15 +51,15 @@ layout: default
 
 
  Dropsolid - The Digital Experience 
Company
-The Dropsolid Experience Cloud delivers an out of box DXP ready 
enhanced Drupal CMS, 
-   Mautic marketing automation platform and Unomi CDP to build 
powerful user experiences. 
-   Apache Unomi is tightly integrated and gives us smart segments 
to allow the website builders to diversify or enrich the content based on the 
surfer. These segments also are used in the marketing automation system. 
-   This results in smart mailings to interested groups. 
+The Dropsolid Experience Cloud delivers an out of box DXP ready 
enhanced Drupal CMS,
+   Mautic marketing automation platform and Unomi CDP to build 
powerful user experiences.
+   Apache Unomi is tightly integrated and gives us smart segments 
to allow the website builders to diversify or enrich the content based on the 
surfer. These segments also are used in the marketing automation system.
+   This results in smart mailings to interested groups.
Apache Unomi is feeding multiple systems here.
 
-"Our goal is to make the digital experience as seamless as 
possible and 
-   Apache Unomi was the puzzle piece that fitted perfectly here. 
-   As we have a rich contribution history we will certainly try to 
help the Apache ecosystem improve, where we can. 
+"Our goal is to make the digital experience as seamless as 
possible and
+   Apache Unomi was the puzzle piece that fitted perfectly here.
+   As we have a rich contribution history we will certainly try to 
help the Apache ecosystem improve, where we can.
Apache Unomi was the obvious customer data platform to 
integrate in our DXP solution." - Mattias Michaux, Director of Engineering.
 https://dropsolid.com/en/dropsolid-experience-cloud"; 
target="_blank">dropsolid.com
 
@@ -72,6 +72,18 @@ layout: default
 
 
 
+
+
+Inoyu
+Inoyu was established by the original developer behind both the 
Jahia DXP and the Apache Unomi project.
+The company specializes in delivering innovative CDP 
implementations, utilizing Unomi as the core
+solution. Inoyu provides commercial support for Apache Unomi, 
along with commercial extensions
+designed to enhance integration and usability.
+
+http://www.inoyu.dev/"; target="_blank">www.inoyu.dev
+
+
+
 
 
 Yupiik



(unomi-site) branch UNOMI-848 created (now 4fa369f)

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-848
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


  at 4fa369f  UNOMI-XXX Add Inoyu.dev to commercial support

This branch includes the following new commits:

 new 4fa369f  UNOMI-XXX Add Inoyu.dev to commercial support

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(unomi-site) branch master updated (324e265 -> a807f55)

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


from 324e265  Merge pull request #33 from apache/UNOMI-843
 add 4fa369f  UNOMI-XXX Add Inoyu.dev to commercial support
 new a807f55  Merge pull request #34 from apache/UNOMI-848

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/webapp/stories.html | 26 +++---
 1 file changed, 19 insertions(+), 7 deletions(-)



(unomi-site) 01/01: Merge pull request #34 from apache/UNOMI-848

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git

commit a807f55e7ec473755c813d965c295cd70aeec8b4
Merge: 324e265 4fa369f
Author: Serge Huber 
AuthorDate: Wed Aug 28 07:51:38 2024 +0200

Merge pull request #34 from apache/UNOMI-848

 src/main/webapp/stories.html | 26 +++---
 1 file changed, 19 insertions(+), 7 deletions(-)



(unomi-site) branch UNOMI-848 deleted (was 4fa369f)

2024-08-27 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-848
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


 was 4fa369f  UNOMI-XXX Add Inoyu.dev to commercial support

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[unomi] branch UNOMI-401-fix-securefilteringclassloader-config created (now f153a2e)

2020-11-17 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-401-fix-securefilteringclassloader-config
in repository https://gitbox.apache.org/repos/asf/unomi.git.


  at f153a2e  UNOMI-401 Fix missing base class in SecureFilteringClassLoader

This branch includes the following new commits:

 new f153a2e  UNOMI-401 Fix missing base class in SecureFilteringClassLoader

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[unomi] 01/01: UNOMI-401 Fix missing base class in SecureFilteringClassLoader

2020-11-17 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-401-fix-securefilteringclassloader-config
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit f153a2ea18ee5ca7792114ede0939ce913e68e05
Author: Serge Huber 
AuthorDate: Tue Nov 17 23:22:20 2020 +0100

UNOMI-401 Fix missing base class in SecureFilteringClassLoader
---
 package/src/main/resources/etc/custom.system.properties | 2 +-
 .../java/org/apache/unomi/scripting/SecureFilteringClassLoader.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/src/main/resources/etc/custom.system.properties 
b/package/src/main/resources/etc/custom.system.properties
index acca87b..4618ac0 100644
--- a/package/src/main/resources/etc/custom.system.properties
+++ b/package/src/main/resources/etc/custom.system.properties
@@ -33,7 +33,7 @@ 
org.apache.unomi.hazelcast.network.port=${env:UNOMI_HAZELCAST_NETWORK_PORT:-5701
 org.apache.unomi.security.root.password=${env:UNOMI_ROOT_PASSWORD:-karaf}
 
 # These parameters control the list of classes that are allowed or forbidden 
when executing expressions.
-org.apache.unomi.scripting.allow=${env:UNOMI_ALLOW_SCRIPTING_CLASSES:-org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*}
+org.apache.unomi.scripting.allow=${env:UNOMI_ALLOW_SCRIPTING_CLASSES:-org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*,java.lang.String}
 org.apache.unomi.scripting.forbid=${env:UNOMI_FORBID_SCRIPTING_CLASSES:-}
 
 # This parameter controls the whole expression filtering system. It is not 
recommended to turn it off. The main reason
diff --git 
a/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
 
b/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
index 028d637..4af57e1 100644
--- 
a/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
+++ 
b/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
@@ -34,7 +34,7 @@ public class SecureFilteringClassLoader extends ClassLoader {
 
 static {
 String systemAllowedClasses = 
System.getProperty("org.apache.unomi.scripting.allow",
-
"org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*");
+
"org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*,java.lang.String");
 if (systemAllowedClasses != null) {
 if ("all".equals(systemAllowedClasses.trim())) {
 defaultAllowedClasses = null;



[unomi] branch master updated (30ba949 -> 0d07365)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 30ba949  UNOMI-399: Provide doc inside the custom.system.properties 
for scripting allow/forbid mechanism (#217)
 add 0d07365  UNOMI-401 Fix missing base class in 
SecureFilteringClassLoader (#219)

No new revisions were added by this update.

Summary of changes:
 package/src/main/resources/etc/custom.system.properties | 2 +-
 .../java/org/apache/unomi/scripting/SecureFilteringClassLoader.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



[unomi] branch UNOMI-400-hardcodedpropertyaccessors-refactoring updated: UNOMI-400 More refactoring on property accessors & added unit test

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch 
UNOMI-400-hardcodedpropertyaccessors-refactoring
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to 
refs/heads/UNOMI-400-hardcodedpropertyaccessors-refactoring by this push:
 new 10ededf  UNOMI-400 More refactoring on property accessors & added unit 
test
10ededf is described below

commit 10ededf90baca45fac0df63b03c1275365289acd
Author: Serge Huber 
AuthorDate: Wed Nov 18 14:27:11 2020 +0100

UNOMI-400 More refactoring on property accessors & added unit test
---
 .../HardcodedPropertyAccessorRegistry.java | 97 +++---
 .../conditions/PropertyConditionEvaluator.java |  4 -
 ...PropertyAccessor.java => CampaignAccessor.java} |  7 +-
 ...dPropertyAccessor.java => ConsentAccessor.java} |  7 +-
 ...opertyAccessor.java => CustomItemAccessor.java} |  7 +-
 ...dedPropertyAccessor.java => EventAccessor.java} |  7 +-
 ...odedPropertyAccessor.java => GoalAccessor.java} |  7 +-
 .../accessors/HardcodedPropertyAccessor.java   |  4 +-
 ...odedPropertyAccessor.java => ItemAccessor.java} |  7 +-
 ...codedPropertyAccessor.java => MapAccessor.java} |  8 +-
 ...PropertyAccessor.java => MetadataAccessor.java} |  7 +-
 ...ertyAccessor.java => MetadataItemAccessor.java} |  7 +-
 ...dPropertyAccessor.java => ProfileAccessor.java} |  5 +-
 ...odedPropertyAccessor.java => RuleAccessor.java} |  7 +-
 ...dPropertyAccessor.java => SessionAccessor.java} |  7 +-
 ...yAccessor.java => TimestampedItemAccessor.java} |  7 +-
 .../HardcodedPropertyAccessorRegistryTest.java | 56 +
 17 files changed, 160 insertions(+), 91 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
similarity index 56%
rename from 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/HardcodedPropertyAccessorRegistry.java
rename to 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
index 6094a8f..59a70b5 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/HardcodedPropertyAccessorRegistry.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -14,12 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.unomi.plugins.baseplugin.conditions.accessors;
+package org.apache.unomi.plugins.baseplugin.conditions;
 
 import org.apache.unomi.api.*;
 import org.apache.unomi.api.campaigns.Campaign;
 import org.apache.unomi.api.goals.Goal;
 import org.apache.unomi.api.rules.Rule;
+import org.apache.unomi.plugins.baseplugin.conditions.accessors.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -36,19 +37,19 @@ public class HardcodedPropertyAccessorRegistry {
 Map propertyAccessors = new HashMap<>();
 
 public HardcodedPropertyAccessorRegistry() {
-propertyAccessors.put(Item.class.getName(), new 
ItemHardcodedPropertyAccessor(this));
-propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemHardcodedPropertyAccessor(this));
-propertyAccessors.put(Metadata.class.getName(), new 
MetadataHardcodedPropertyAccessor(this));
-propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemHardcodedPropertyAccessor(this));
-propertyAccessors.put(Event.class.getName(), new 
EventHardcodedPropertyAccessor(this));
-propertyAccessors.put(Profile.class.getName(), new 
ProfileHardcodedPropertyAccessor(this));
-propertyAccessors.put(Consent.class.getName(), new 
ConsentHardcodedPropertyAccessor(this));
-propertyAccessors.put(Session.class.getName(), new 
SessionHardcodedPropertyAccessor(this));
-propertyAccessors.put(Rule.class.getName(), new 
RuleHardcodedPropertyAccessor(this));
-propertyAccessors.put(Goal.class.getName(), new 
GoalHardcodedPropertyAccessor(this));
-propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemHardcodedPropertyAccessor(this));
-propertyAccessors.put(Campaign.class.getName(), new 
CampaignHardcodedPropertyAccessor(this));
-propertyAccessors.put(Map.class.getName(), new 
MapHardcodedPropertyAccessor(this));
+propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
+propertyAccessors.put(TimestampedIt

[unomi] branch master updated: UNOMI-400 Refactoring of hardcoded property accessors (#218)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 5de4cab  UNOMI-400 Refactoring of hardcoded property accessors (#218)
5de4cab is described below

commit 5de4cab84c003688fc72664a9fbda4c33143d880
Author: Serge Huber 
AuthorDate: Wed Nov 18 14:54:42 2020 +0100

UNOMI-400 Refactoring of hardcoded property accessors (#218)

* UNOMI-400 Refactoring of hardcoded property accessors

* UNOMI-400 More refactoring on property accessors & added unit test
---
 .../HardcodedPropertyAccessorRegistry.java | 132 +++
 .../conditions/PropertyConditionEvaluator.java | 256 +
 .../conditions/accessors/CampaignAccessor.java |  44 
 .../conditions/accessors/ConsentAccessor.java  |  44 
 .../conditions/accessors/CustomItemAccessor.java   |  35 +++
 .../conditions/accessors/EventAccessor.java|  56 +
 .../conditions/accessors/GoalAccessor.java |  35 +++
 .../accessors/HardcodedPropertyAccessor.java   |  38 +++
 .../conditions/accessors/ItemAccessor.java |  44 
 .../conditions/accessors/MapAccessor.java  |  40 
 .../conditions/accessors/MetadataAccessor.java |  53 +
 .../conditions/accessors/MetadataItemAccessor.java |  34 +++
 .../conditions/accessors/ProfileAccessor.java  |  50 
 .../conditions/accessors/RuleAccessor.java |  38 +++
 .../conditions/accessors/SessionAccessor.java  |  53 +
 .../accessors/TimestampedItemAccessor.java |  35 +++
 .../HardcodedPropertyAccessorRegistryTest.java |  56 +
 .../conditions/PropertyConditionEvaluatorTest.java |   4 +-
 18 files changed, 796 insertions(+), 251 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
new file mode 100644
index 000..59a70b5
--- /dev/null
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.plugins.baseplugin.conditions;
+
+import org.apache.unomi.api.*;
+import org.apache.unomi.api.campaigns.Campaign;
+import org.apache.unomi.api.goals.Goal;
+import org.apache.unomi.api.rules.Rule;
+import org.apache.unomi.plugins.baseplugin.conditions.accessors.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+
+/**
+ * This class contains the registry of all the hardcoded property accessors.
+ * For the moment this list of accessors is hardcoded, but in a future update 
it could be made dynamic.
+ */
+public class HardcodedPropertyAccessorRegistry {
+
+private static final Logger logger = 
LoggerFactory.getLogger(HardcodedPropertyAccessorRegistry.class.getName());
+
+Map propertyAccessors = new HashMap<>();
+
+public HardcodedPropertyAccessorRegistry() {
+propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
+propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemAccessor(this));
+propertyAccessors.put(Event.class.getName(), new EventAccessor(this));
+propertyAccessors.put(Profile.class.getName(), new 
ProfileAccessor(this));
+propertyAccessors.put(Consent.class.getName(), new 
ConsentAccessor(this));
+propertyAccessors.put(Session.class.getName(), new 
SessionAccessor(this));
+propertyAccessors.put(Rule.class.getName(), new RuleAccessor(this));
+propertyAccessors.put(Goal.class.getName(), new GoalAccessor(this));
+propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemAccessor(this));
+propertyAccess

[unomi] 02/02: UNOMI-400 Refactoring of hardcoded property accessors (#218)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 267aad02fd76aef36f0419752a81be0f95cb843e
Author: Serge Huber 
AuthorDate: Wed Nov 18 14:54:42 2020 +0100

UNOMI-400 Refactoring of hardcoded property accessors (#218)

* UNOMI-400 Refactoring of hardcoded property accessors

* UNOMI-400 More refactoring on property accessors & added unit test

(cherry picked from commit 5de4cab84c003688fc72664a9fbda4c33143d880)
---
 .../HardcodedPropertyAccessorRegistry.java | 132 +++
 .../conditions/PropertyConditionEvaluator.java | 256 +
 .../conditions/accessors/CampaignAccessor.java |  44 
 .../conditions/accessors/ConsentAccessor.java  |  44 
 .../conditions/accessors/CustomItemAccessor.java   |  35 +++
 .../conditions/accessors/EventAccessor.java|  56 +
 .../conditions/accessors/GoalAccessor.java |  35 +++
 .../accessors/HardcodedPropertyAccessor.java   |  38 +++
 .../conditions/accessors/ItemAccessor.java |  44 
 .../conditions/accessors/MapAccessor.java  |  40 
 .../conditions/accessors/MetadataAccessor.java |  53 +
 .../conditions/accessors/MetadataItemAccessor.java |  34 +++
 .../conditions/accessors/ProfileAccessor.java  |  50 
 .../conditions/accessors/RuleAccessor.java |  38 +++
 .../conditions/accessors/SessionAccessor.java  |  53 +
 .../accessors/TimestampedItemAccessor.java |  35 +++
 .../HardcodedPropertyAccessorRegistryTest.java |  56 +
 .../conditions/PropertyConditionEvaluatorTest.java |   4 +-
 18 files changed, 796 insertions(+), 251 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
new file mode 100644
index 000..59a70b5
--- /dev/null
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.plugins.baseplugin.conditions;
+
+import org.apache.unomi.api.*;
+import org.apache.unomi.api.campaigns.Campaign;
+import org.apache.unomi.api.goals.Goal;
+import org.apache.unomi.api.rules.Rule;
+import org.apache.unomi.plugins.baseplugin.conditions.accessors.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+
+/**
+ * This class contains the registry of all the hardcoded property accessors.
+ * For the moment this list of accessors is hardcoded, but in a future update 
it could be made dynamic.
+ */
+public class HardcodedPropertyAccessorRegistry {
+
+private static final Logger logger = 
LoggerFactory.getLogger(HardcodedPropertyAccessorRegistry.class.getName());
+
+Map propertyAccessors = new HashMap<>();
+
+public HardcodedPropertyAccessorRegistry() {
+propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
+propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemAccessor(this));
+propertyAccessors.put(Event.class.getName(), new EventAccessor(this));
+propertyAccessors.put(Profile.class.getName(), new 
ProfileAccessor(this));
+propertyAccessors.put(Consent.class.getName(), new 
ConsentAccessor(this));
+propertyAccessors.put(Session.class.getName(), new 
SessionAccessor(this));
+propertyAccessors.put(Rule.class.getName(), new RuleAccessor(this));
+propertyAccessors.put(Goal.class.getName(), new GoalAccessor(this));
+propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemAccessor(this));
+propertyAccessors.put(Campaign.class.getName(), new 
CampaignAccessor(this));
+propertyAccessor

[unomi] branch unomi-1.5.x updated (76cddd1 -> 267aad0)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 76cddd1  UNOMI-399: Provide doc inside the custom.system.properties 
for scripting allow/forbid mechanism (#217)
 new 7cf12c4  UNOMI-401 Fix missing base class in 
SecureFilteringClassLoader (#219)
 new 267aad0  UNOMI-400 Refactoring of hardcoded property accessors (#218)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/resources/etc/custom.system.properties|   2 +-
 .../HardcodedPropertyAccessorRegistry.java | 132 +++
 .../conditions/PropertyConditionEvaluator.java | 256 +
 .../conditions/accessors/CampaignAccessor.java |  44 
 .../conditions/accessors/ConsentAccessor.java  |  44 
 .../conditions/accessors/CustomItemAccessor.java   |  22 +-
 .../conditions/accessors/EventAccessor.java|  56 +
 .../conditions/accessors/GoalAccessor.java |  22 +-
 .../accessors/HardcodedPropertyAccessor.java   |  38 +++
 .../ItemAccessor.java} |  33 +--
 .../MapAccessor.java}  |  26 ++-
 .../conditions/accessors/MetadataAccessor.java |  53 +
 .../conditions/accessors/MetadataItemAccessor.java |  23 +-
 .../conditions/accessors/ProfileAccessor.java  |  50 
 .../conditions/accessors/RuleAccessor.java |  30 ++-
 .../conditions/accessors/SessionAccessor.java  |  53 +
 .../accessors/TimestampedItemAccessor.java |  22 +-
 .../HardcodedPropertyAccessorRegistryTest.java |  56 +
 .../conditions/PropertyConditionEvaluatorTest.java |   4 +-
 .../scripting/SecureFilteringClassLoader.java  |   2 +-
 20 files changed, 641 insertions(+), 327 deletions(-)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/CampaignAccessor.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/ConsentAccessor.java
 copy 
metrics/src/main/java/org/apache/unomi/metrics/commands/DeactivateCommand.java 
=> 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/CustomItemAccessor.java
 (55%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/EventAccessor.java
 copy 
metrics/src/main/java/org/apache/unomi/metrics/commands/DeactivateCommand.java 
=> 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/GoalAccessor.java
 (58%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/HardcodedPropertyAccessor.java
 copy 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/{NotConditionEvaluator.java
 => accessors/ItemAccessor.java} (50%)
 copy 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/{MatchAllConditionESQueryBuilder.java
 => accessors/MapAccessor.java} (54%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/MetadataAccessor.java
 copy 
extensions/lists-extension/services/src/main/java/org/apache/unomi/lists/UserList.java
 => 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/MetadataItemAccessor.java
 (58%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/ProfileAccessor.java
 copy api/src/main/java/org/apache/unomi/api/actions/ActionPostExecutor.java => 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/RuleAccessor.java
 (55%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/SessionAccessor.java
 copy 
metrics/src/main/java/org/apache/unomi/metrics/commands/DeactivateCommand.java 
=> 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/TimestampedItemAccessor.java
 (56%)
 create mode 100644 
plugins/baseplugin/src/test/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistryTest.java



[unomi] 01/02: UNOMI-401 Fix missing base class in SecureFilteringClassLoader (#219)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 7cf12c42644e1e8695136ca69288033b357d19ba
Author: Serge Huber 
AuthorDate: Wed Nov 18 09:39:43 2020 +0100

UNOMI-401 Fix missing base class in SecureFilteringClassLoader (#219)

(cherry picked from commit 0d073658f454ff19e127c902d699fe51ffe8037d)
---
 package/src/main/resources/etc/custom.system.properties | 2 +-
 .../java/org/apache/unomi/scripting/SecureFilteringClassLoader.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/src/main/resources/etc/custom.system.properties 
b/package/src/main/resources/etc/custom.system.properties
index acca87b..4618ac0 100644
--- a/package/src/main/resources/etc/custom.system.properties
+++ b/package/src/main/resources/etc/custom.system.properties
@@ -33,7 +33,7 @@ 
org.apache.unomi.hazelcast.network.port=${env:UNOMI_HAZELCAST_NETWORK_PORT:-5701
 org.apache.unomi.security.root.password=${env:UNOMI_ROOT_PASSWORD:-karaf}
 
 # These parameters control the list of classes that are allowed or forbidden 
when executing expressions.
-org.apache.unomi.scripting.allow=${env:UNOMI_ALLOW_SCRIPTING_CLASSES:-org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*}
+org.apache.unomi.scripting.allow=${env:UNOMI_ALLOW_SCRIPTING_CLASSES:-org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*,java.lang.String}
 org.apache.unomi.scripting.forbid=${env:UNOMI_FORBID_SCRIPTING_CLASSES:-}
 
 # This parameter controls the whole expression filtering system. It is not 
recommended to turn it off. The main reason
diff --git 
a/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
 
b/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
index 028d637..4af57e1 100644
--- 
a/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
+++ 
b/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
@@ -34,7 +34,7 @@ public class SecureFilteringClassLoader extends ClassLoader {
 
 static {
 String systemAllowedClasses = 
System.getProperty("org.apache.unomi.scripting.allow",
-
"org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*");
+
"org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*,java.lang.String");
 if (systemAllowedClasses != null) {
 if ("all".equals(systemAllowedClasses.trim())) {
 defaultAllowedClasses = null;



[unomi] branch unomi-1.4.x updated (586bf31 -> b75db81)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch unomi-1.4.x
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 586bf31  UNOMI-399: Provide doc inside the custom.system.properties 
for scripting allow/forbid mechanism (#217)
 new c4d28ca  UNOMI-401 Fix missing base class in 
SecureFilteringClassLoader (#219)
 new b75db81  UNOMI-400 Refactoring of hardcoded property accessors (#218)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/resources/etc/custom.system.properties|   2 +-
 .../HardcodedPropertyAccessorRegistry.java | 132 +++
 .../conditions/PropertyConditionEvaluator.java | 256 +
 .../conditions/accessors/CampaignAccessor.java |  44 
 .../conditions/accessors/ConsentAccessor.java  |  44 
 .../conditions/accessors/CustomItemAccessor.java   |  22 +-
 .../conditions/accessors/EventAccessor.java|  56 +
 .../conditions/accessors/GoalAccessor.java |  22 +-
 .../accessors/HardcodedPropertyAccessor.java   |  38 +++
 .../ItemAccessor.java} |  33 +--
 .../MapAccessor.java}  |  26 ++-
 .../conditions/accessors/MetadataAccessor.java |  53 +
 .../conditions/accessors/MetadataItemAccessor.java |  23 +-
 .../conditions/accessors/ProfileAccessor.java  |  50 
 .../conditions/accessors/RuleAccessor.java |  30 ++-
 .../conditions/accessors/SessionAccessor.java  |  53 +
 .../accessors/TimestampedItemAccessor.java |  22 +-
 .../HardcodedPropertyAccessorRegistryTest.java |  56 +
 .../conditions/PropertyConditionEvaluatorTest.java |   4 +-
 .../scripting/SecureFilteringClassLoader.java  |   2 +-
 20 files changed, 641 insertions(+), 327 deletions(-)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/CampaignAccessor.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/ConsentAccessor.java
 copy 
metrics/src/main/java/org/apache/unomi/metrics/commands/DeactivateCommand.java 
=> 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/CustomItemAccessor.java
 (55%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/EventAccessor.java
 copy 
metrics/src/main/java/org/apache/unomi/metrics/commands/DeactivateCommand.java 
=> 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/GoalAccessor.java
 (58%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/HardcodedPropertyAccessor.java
 copy 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/{NotConditionEvaluator.java
 => accessors/ItemAccessor.java} (50%)
 copy 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/{MatchAllConditionESQueryBuilder.java
 => accessors/MapAccessor.java} (54%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/MetadataAccessor.java
 copy 
extensions/lists-extension/services/src/main/java/org/apache/unomi/lists/UserList.java
 => 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/MetadataItemAccessor.java
 (58%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/ProfileAccessor.java
 copy api/src/main/java/org/apache/unomi/api/actions/ActionPostExecutor.java => 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/RuleAccessor.java
 (55%)
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/SessionAccessor.java
 copy 
metrics/src/main/java/org/apache/unomi/metrics/commands/DeactivateCommand.java 
=> 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/accessors/TimestampedItemAccessor.java
 (56%)
 create mode 100644 
plugins/baseplugin/src/test/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistryTest.java



[unomi] 02/02: UNOMI-400 Refactoring of hardcoded property accessors (#218)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.4.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit b75db8158c27f1136298df002842bca475b577a6
Author: Serge Huber 
AuthorDate: Wed Nov 18 14:54:42 2020 +0100

UNOMI-400 Refactoring of hardcoded property accessors (#218)

* UNOMI-400 Refactoring of hardcoded property accessors

* UNOMI-400 More refactoring on property accessors & added unit test

(cherry picked from commit 5de4cab84c003688fc72664a9fbda4c33143d880)
---
 .../HardcodedPropertyAccessorRegistry.java | 132 +++
 .../conditions/PropertyConditionEvaluator.java | 256 +
 .../conditions/accessors/CampaignAccessor.java |  44 
 .../conditions/accessors/ConsentAccessor.java  |  44 
 .../conditions/accessors/CustomItemAccessor.java   |  35 +++
 .../conditions/accessors/EventAccessor.java|  56 +
 .../conditions/accessors/GoalAccessor.java |  35 +++
 .../accessors/HardcodedPropertyAccessor.java   |  38 +++
 .../conditions/accessors/ItemAccessor.java |  44 
 .../conditions/accessors/MapAccessor.java  |  40 
 .../conditions/accessors/MetadataAccessor.java |  53 +
 .../conditions/accessors/MetadataItemAccessor.java |  34 +++
 .../conditions/accessors/ProfileAccessor.java  |  50 
 .../conditions/accessors/RuleAccessor.java |  38 +++
 .../conditions/accessors/SessionAccessor.java  |  53 +
 .../accessors/TimestampedItemAccessor.java |  35 +++
 .../HardcodedPropertyAccessorRegistryTest.java |  56 +
 .../conditions/PropertyConditionEvaluatorTest.java |   4 +-
 18 files changed, 796 insertions(+), 251 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
new file mode 100644
index 000..59a70b5
--- /dev/null
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.plugins.baseplugin.conditions;
+
+import org.apache.unomi.api.*;
+import org.apache.unomi.api.campaigns.Campaign;
+import org.apache.unomi.api.goals.Goal;
+import org.apache.unomi.api.rules.Rule;
+import org.apache.unomi.plugins.baseplugin.conditions.accessors.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+
+/**
+ * This class contains the registry of all the hardcoded property accessors.
+ * For the moment this list of accessors is hardcoded, but in a future update 
it could be made dynamic.
+ */
+public class HardcodedPropertyAccessorRegistry {
+
+private static final Logger logger = 
LoggerFactory.getLogger(HardcodedPropertyAccessorRegistry.class.getName());
+
+Map propertyAccessors = new HashMap<>();
+
+public HardcodedPropertyAccessorRegistry() {
+propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
+propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemAccessor(this));
+propertyAccessors.put(Event.class.getName(), new EventAccessor(this));
+propertyAccessors.put(Profile.class.getName(), new 
ProfileAccessor(this));
+propertyAccessors.put(Consent.class.getName(), new 
ConsentAccessor(this));
+propertyAccessors.put(Session.class.getName(), new 
SessionAccessor(this));
+propertyAccessors.put(Rule.class.getName(), new RuleAccessor(this));
+propertyAccessors.put(Goal.class.getName(), new GoalAccessor(this));
+propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemAccessor(this));
+propertyAccessors.put(Campaign.class.getName(), new 
CampaignAccessor(this));
+propertyAccessor

[unomi] 01/02: UNOMI-401 Fix missing base class in SecureFilteringClassLoader (#219)

2020-11-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.4.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit c4d28ca6974ae9a6c1f406a508bb14ab910fbff0
Author: Serge Huber 
AuthorDate: Wed Nov 18 09:39:43 2020 +0100

UNOMI-401 Fix missing base class in SecureFilteringClassLoader (#219)

(cherry picked from commit 0d073658f454ff19e127c902d699fe51ffe8037d)
---
 package/src/main/resources/etc/custom.system.properties | 2 +-
 .../java/org/apache/unomi/scripting/SecureFilteringClassLoader.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/src/main/resources/etc/custom.system.properties 
b/package/src/main/resources/etc/custom.system.properties
index 43cd801..91f23d3 100644
--- a/package/src/main/resources/etc/custom.system.properties
+++ b/package/src/main/resources/etc/custom.system.properties
@@ -33,7 +33,7 @@ 
org.apache.unomi.hazelcast.network.port=${env:UNOMI_HAZELCAST_NETWORK_PORT:-5701
 org.apache.unomi.security.root.password=${env:UNOMI_ROOT_PASSWORD:-karaf}
 
 # These parameters control the list of classes that are allowed or forbidden 
when executing expressions.
-org.apache.unomi.scripting.allow=${env:UNOMI_ALLOW_SCRIPTING_CLASSES:-org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*}
+org.apache.unomi.scripting.allow=${env:UNOMI_ALLOW_SCRIPTING_CLASSES:-org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*,java.lang.String}
 org.apache.unomi.scripting.forbid=${env:UNOMI_FORBID_SCRIPTING_CLASSES:-}
 
 # This parameter controls the whole expression filtering system. It is not 
recommended to turn it off. The main reason
diff --git 
a/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
 
b/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
index 028d637..4af57e1 100644
--- 
a/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
+++ 
b/scripting/src/main/java/org/apache/unomi/scripting/SecureFilteringClassLoader.java
@@ -34,7 +34,7 @@ public class SecureFilteringClassLoader extends ClassLoader {
 
 static {
 String systemAllowedClasses = 
System.getProperty("org.apache.unomi.scripting.allow",
-
"org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*");
+
"org.apache.unomi.api.Event,org.apache.unomi.api.Profile,org.apache.unomi.api.Session,org.apache.unomi.api.Item,org.apache.unomi.api.CustomItem,ognl.*,java.lang.Object,java.util.Map,java.util.HashMap,java.lang.Integer,org.mvel2.*,java.lang.String");
 if (systemAllowedClasses != null) {
 if ("all".equals(systemAllowedClasses.trim())) {
 defaultAllowedClasses = null;



[unomi] branch master updated: UNOMI-366: Implement increment interest event type & action (#201)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)
a535d03 is described below

commit a535d034abe0e1f09933dfc423486690dad94a33
Author: anatol-sialitski <53557255+anatol-sialit...@users.noreply.github.com>
AuthorDate: Thu Nov 19 11:17:38 2020 +0300

UNOMI-366: Implement increment interest event type & action (#201)

* UNOMI-366: Implement increment interest event type & action

* UNOMI-366: Implement increment interest event type & action
---
 .../apache/unomi/itests/IncrementInterestsIT.java  | 140 +
 .../main/resources/etc/custom.system.properties|   7 ++
 .../actions/IncrementInterestAction.java   | 118 +
 .../META-INF/cxs/actions/incrementInterest.json|  19 +++
 .../META-INF/cxs/conditions/incrementInterest.json |  22 
 .../META-INF/cxs/rules/incrementInterest.json  |  21 
 .../resources/OSGI-INF/blueprint/blueprint.xml |  38 --
 7 files changed, 357 insertions(+), 8 deletions(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java 
b/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
new file mode 100644
index 000..9ebaa79
--- /dev/null
+++ b/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+package org.apache.unomi.itests;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+
+import javax.inject.Inject;
+
+import org.apache.unomi.api.Event;
+import org.apache.unomi.api.Profile;
+import org.apache.unomi.api.Topic;
+import org.apache.unomi.api.services.EventService;
+import org.apache.unomi.api.services.ProfileService;
+import org.apache.unomi.api.services.TopicService;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerSuite;
+import org.ops4j.pax.exam.util.Filter;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerSuite.class)
+public class IncrementInterestsIT
+extends BaseIT
+{
+
+@Inject
+@Filter(timeout = 60)
+protected ProfileService profileService;
+
+@Inject
+@Filter(timeout = 60)
+protected EventService eventService;
+
+@Inject
+@Filter(timeout = 60)
+protected TopicService topicService;
+
+@Test
+@SuppressWarnings("unchecked")
+public void test()
+throws InterruptedException
+{
+final Topic topic = createTopic( "topicId" );
+final Profile profile = createProfile();
+
+final Map interestsAsMap = new HashMap<>();
+interestsAsMap.put( topic.getTopicId(), 50.0 );
+interestsAsMap.put( "unknown", 10.0 );
+
+final Event event = createEvent( profile, interestsAsMap );
+
+try
+{
+int eventCode = eventService.send( event );
+
+if ( eventCode == EventService.PROFILE_UPDATED )
+{
+Profile updatedProfile = profileService.save( 
event.getProfile() );
+
+refreshPersistence();
+
+Map interests = (Map) 
updatedProfile.getProperty( "interests" );
+
+Assert.assertEquals( 0.5, interests.get( topic.getTopicId() ), 
0.0 );
+Assert.assertFalse( interests.containsKey( "unknown" ) );
+}
+}
+finally
+{
+topicService.delete( topic.getItemId() );
+profileService.delete( profile.getItemId(), false );
+}
+}
+
+private Event createEvent( Profile profile, Map 
interestsAsMap )
+{
+final Event event = new Event( "incrementInterest", null, profile, 
null, null, profile, ne

[unomi] branch master updated (5de4cab -> a535d03)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 5de4cab  UNOMI-400 Refactoring of hardcoded property accessors (#218)
 add a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)

No new revisions were added by this update.

Summary of changes:
 .../apache/unomi/itests/IncrementInterestsIT.java  | 140 +
 .../main/resources/etc/custom.system.properties|   7 ++
 .../actions/IncrementInterestAction.java   | 118 +
 .../META-INF/cxs/actions/incrementInterest.json|  19 +++
 .../META-INF/cxs/conditions/incrementInterest.json |   7 +-
 .../META-INF/cxs/rules/incrementInterest.json  |  21 
 .../resources/OSGI-INF/blueprint/blueprint.xml |  38 --
 7 files changed, 338 insertions(+), 12 deletions(-)
 create mode 100644 
itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterest.json
 copy 
graphql/cxs-impl/src/main/resources/META-INF/cxs/conditions/cdpSessionEvent.json
 => 
plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/incrementInterest.json
 (68%)
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterest.json



[unomi] branch master updated (a535d03 -> 9e346c9)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)
 add 9e346c9  Return error to the client when exception is thrown from 
Elasticsearch impl (#202)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/unomi/itests/ProfileServiceIT.java  |  24 ++
 .../main/resources/etc/custom.system.properties|   2 +
 .../ElasticSearchPersistenceServiceImpl.java   |   8 +
 .../resources/OSGI-INF/blueprint/blueprint.xml |   2 +
 .../org.apache.unomi.persistence.elasticsearch.cfg |   5 +-
 .../apache/unomi/rest/RuntimeExceptionMapper.java  |  18 +-
 .../java/org/apache/unomi/web/ClientServlet.java   |  38 +-
 .../java/org/apache/unomi/web/ContextServlet.java  | 389 +++--
 .../apache/unomi/web/EventsCollectorServlet.java   |  24 +-
 9 files changed, 287 insertions(+), 223 deletions(-)
 copy 
extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ConfigRestExceptionMapper.java
 => rest/src/main/java/org/apache/unomi/rest/RuntimeExceptionMapper.java (70%)



[unomi] branch master updated (5de4cab -> a535d03)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 5de4cab  UNOMI-400 Refactoring of hardcoded property accessors (#218)
 add a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)

No new revisions were added by this update.

Summary of changes:
 .../apache/unomi/itests/IncrementInterestsIT.java  | 140 +
 .../main/resources/etc/custom.system.properties|   7 ++
 .../actions/IncrementInterestAction.java   | 118 +
 .../META-INF/cxs/actions/incrementInterest.json|  19 +++
 .../META-INF/cxs/conditions/incrementInterest.json |   7 +-
 .../META-INF/cxs/rules/incrementInterest.json  |  21 
 .../resources/OSGI-INF/blueprint/blueprint.xml |  38 --
 7 files changed, 338 insertions(+), 12 deletions(-)
 create mode 100644 
itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterest.json
 copy 
graphql/cxs-impl/src/main/resources/META-INF/cxs/conditions/cdpSessionEvent.json
 => 
plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/incrementInterest.json
 (68%)
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterest.json



[unomi] branch master updated (a535d03 -> 9e346c9)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)
 add 9e346c9  Return error to the client when exception is thrown from 
Elasticsearch impl (#202)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/unomi/itests/ProfileServiceIT.java  |  24 ++
 .../main/resources/etc/custom.system.properties|   2 +
 .../ElasticSearchPersistenceServiceImpl.java   |   8 +
 .../resources/OSGI-INF/blueprint/blueprint.xml |   2 +
 .../org.apache.unomi.persistence.elasticsearch.cfg |   5 +-
 .../apache/unomi/rest/RuntimeExceptionMapper.java  |  18 +-
 .../java/org/apache/unomi/web/ClientServlet.java   |  38 +-
 .../java/org/apache/unomi/web/ContextServlet.java  | 389 +++--
 .../apache/unomi/web/EventsCollectorServlet.java   |  24 +-
 9 files changed, 287 insertions(+), 223 deletions(-)
 copy 
extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ConfigRestExceptionMapper.java
 => rest/src/main/java/org/apache/unomi/rest/RuntimeExceptionMapper.java (70%)



[unomi] branch master updated (a535d03 -> 9e346c9)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)
 add 9e346c9  Return error to the client when exception is thrown from 
Elasticsearch impl (#202)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/unomi/itests/ProfileServiceIT.java  |  24 ++
 .../main/resources/etc/custom.system.properties|   2 +
 .../ElasticSearchPersistenceServiceImpl.java   |   8 +
 .../resources/OSGI-INF/blueprint/blueprint.xml |   2 +
 .../org.apache.unomi.persistence.elasticsearch.cfg |   5 +-
 .../apache/unomi/rest/RuntimeExceptionMapper.java  |  18 +-
 .../java/org/apache/unomi/web/ClientServlet.java   |  38 +-
 .../java/org/apache/unomi/web/ContextServlet.java  | 389 +++--
 .../apache/unomi/web/EventsCollectorServlet.java   |  24 +-
 9 files changed, 287 insertions(+), 223 deletions(-)
 copy 
extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ConfigRestExceptionMapper.java
 => rest/src/main/java/org/apache/unomi/rest/RuntimeExceptionMapper.java (70%)



[unomi] branch master updated (5de4cab -> a535d03)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 5de4cab  UNOMI-400 Refactoring of hardcoded property accessors (#218)
 add a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)

No new revisions were added by this update.

Summary of changes:
 .../apache/unomi/itests/IncrementInterestsIT.java  | 140 +
 .../main/resources/etc/custom.system.properties|   7 ++
 .../actions/IncrementInterestAction.java   | 118 +
 .../META-INF/cxs/actions/incrementInterest.json|  19 +++
 .../META-INF/cxs/conditions/incrementInterest.json |   7 +-
 .../META-INF/cxs/rules/incrementInterest.json  |  21 
 .../resources/OSGI-INF/blueprint/blueprint.xml |  38 --
 7 files changed, 338 insertions(+), 12 deletions(-)
 create mode 100644 
itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterest.json
 copy 
graphql/cxs-impl/src/main/resources/META-INF/cxs/conditions/cdpSessionEvent.json
 => 
plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/incrementInterest.json
 (68%)
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterest.json



[unomi] branch master updated (5de4cab -> a535d03)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 5de4cab  UNOMI-400 Refactoring of hardcoded property accessors (#218)
 add a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)

No new revisions were added by this update.

Summary of changes:
 .../apache/unomi/itests/IncrementInterestsIT.java  | 140 +
 .../main/resources/etc/custom.system.properties|   7 ++
 .../actions/IncrementInterestAction.java   | 118 +
 .../META-INF/cxs/actions/incrementInterest.json|  19 +++
 .../META-INF/cxs/conditions/incrementInterest.json |   7 +-
 .../META-INF/cxs/rules/incrementInterest.json  |  21 
 .../resources/OSGI-INF/blueprint/blueprint.xml |  38 --
 7 files changed, 338 insertions(+), 12 deletions(-)
 create mode 100644 
itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
 create mode 100644 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterest.json
 copy 
graphql/cxs-impl/src/main/resources/META-INF/cxs/conditions/cdpSessionEvent.json
 => 
plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/incrementInterest.json
 (68%)
 create mode 100644 
plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterest.json



[unomi] branch master updated (a535d03 -> 9e346c9)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)
 add 9e346c9  Return error to the client when exception is thrown from 
Elasticsearch impl (#202)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/unomi/itests/ProfileServiceIT.java  |  24 ++
 .../main/resources/etc/custom.system.properties|   2 +
 .../ElasticSearchPersistenceServiceImpl.java   |   8 +
 .../resources/OSGI-INF/blueprint/blueprint.xml |   2 +
 .../org.apache.unomi.persistence.elasticsearch.cfg |   5 +-
 .../apache/unomi/rest/RuntimeExceptionMapper.java  |  18 +-
 .../java/org/apache/unomi/web/ClientServlet.java   |  38 +-
 .../java/org/apache/unomi/web/ContextServlet.java  | 389 +++--
 .../apache/unomi/web/EventsCollectorServlet.java   |  24 +-
 9 files changed, 287 insertions(+), 223 deletions(-)
 copy 
extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ConfigRestExceptionMapper.java
 => rest/src/main/java/org/apache/unomi/rest/RuntimeExceptionMapper.java (70%)



[unomi] branch master updated (a535d03 -> 9e346c9)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from a535d03  UNOMI-366: Implement increment interest event type & action 
(#201)
 add 9e346c9  Return error to the client when exception is thrown from 
Elasticsearch impl (#202)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/unomi/itests/ProfileServiceIT.java  |  24 ++
 .../main/resources/etc/custom.system.properties|   2 +
 .../ElasticSearchPersistenceServiceImpl.java   |   8 +
 .../resources/OSGI-INF/blueprint/blueprint.xml |   2 +
 .../org.apache.unomi.persistence.elasticsearch.cfg |   5 +-
 .../apache/unomi/rest/RuntimeExceptionMapper.java  |  18 +-
 .../java/org/apache/unomi/web/ClientServlet.java   |  38 +-
 .../java/org/apache/unomi/web/ContextServlet.java  | 389 +++--
 .../apache/unomi/web/EventsCollectorServlet.java   |  24 +-
 9 files changed, 287 insertions(+), 223 deletions(-)
 copy 
extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ConfigRestExceptionMapper.java
 => rest/src/main/java/org/apache/unomi/rest/RuntimeExceptionMapper.java (70%)



[unomi] 01/01: UNOMI-400 Fix class hierarchy lookup for property condition evaluator

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-400-class-hierarchy-fix
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 5a0b71430b0627226570956dae45089e3af9eabf
Author: Serge Huber 
AuthorDate: Thu Nov 19 21:12:10 2020 +0100

UNOMI-400 Fix class hierarchy lookup for property condition evaluator
---
 .../HardcodedPropertyAccessorRegistry.java | 60 --
 .../conditions/accessors/MetadataItemAccessor.java |  2 +-
 .../HardcodedPropertyAccessorRegistryTest.java | 20 
 .../conditions/PropertyConditionEvaluatorTest.java | 29 ---
 4 files changed, 87 insertions(+), 24 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
index 59a70b5..56f8cd5 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -25,6 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * This class contains the registry of all the hardcoded property accessors.
@@ -34,22 +35,23 @@ public class HardcodedPropertyAccessorRegistry {
 
 private static final Logger logger = 
LoggerFactory.getLogger(HardcodedPropertyAccessorRegistry.class.getName());
 
-Map propertyAccessors = new HashMap<>();
+protected Map, HardcodedPropertyAccessor> propertyAccessors = new 
HashMap<>();
+protected Map, List>> cachedClassAncestors = new 
HashMap<>();
 
 public HardcodedPropertyAccessorRegistry() {
-propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
-propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
-propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
-propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemAccessor(this));
-propertyAccessors.put(Event.class.getName(), new EventAccessor(this));
-propertyAccessors.put(Profile.class.getName(), new 
ProfileAccessor(this));
-propertyAccessors.put(Consent.class.getName(), new 
ConsentAccessor(this));
-propertyAccessors.put(Session.class.getName(), new 
SessionAccessor(this));
-propertyAccessors.put(Rule.class.getName(), new RuleAccessor(this));
-propertyAccessors.put(Goal.class.getName(), new GoalAccessor(this));
-propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemAccessor(this));
-propertyAccessors.put(Campaign.class.getName(), new 
CampaignAccessor(this));
-propertyAccessors.put(Map.class.getName(), new MapAccessor(this));
+propertyAccessors.put(Item.class, new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class, new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class, new MetadataAccessor(this));
+propertyAccessors.put(TimestampedItem.class, new 
TimestampedItemAccessor(this));
+propertyAccessors.put(Event.class, new EventAccessor(this));
+propertyAccessors.put(Profile.class, new ProfileAccessor(this));
+propertyAccessors.put(Consent.class, new ConsentAccessor(this));
+propertyAccessors.put(Session.class, new SessionAccessor(this));
+propertyAccessors.put(Rule.class, new RuleAccessor(this));
+propertyAccessors.put(Goal.class, new GoalAccessor(this));
+propertyAccessors.put(CustomItem.class, new CustomItemAccessor(this));
+propertyAccessors.put(Campaign.class, new CampaignAccessor(this));
+propertyAccessors.put(Map.class, new MapAccessor(this));
 }
 
 public static class NextTokens {
@@ -115,10 +117,16 @@ public class HardcodedPropertyAccessorRegistry {
 NextTokens nextTokens = getNextTokens(expression);
 List> lookupClasses = new ArrayList<>();
 lookupClasses.add(object.getClass());
-lookupClasses.add(object.getClass().getSuperclass());
-lookupClasses.addAll(Arrays.asList(object.getClass().getInterfaces()));
+List> objectClassAncestors = 
cachedClassAncestors.get(object.getClass());
+if (objectClassAncestors == null) {
+objectClassAncestors = collectAncestors(object.getClass(), 
propertyAccessors.keySet());
+cachedClassAncestors.put(object.getClass(), objectClassAncestors);
+}
+if (objectClassAncestors != null) {
+lookupClasses.addAll(objectClassAncestors);
+}
 for (Class lookupClass : lookupClasses) {
-HardcodedPropertyAccessor propertyAccessor = 
pr

[unomi] branch UNOMI-400-class-hierarchy-fix created (now 5a0b714)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-400-class-hierarchy-fix
in repository https://gitbox.apache.org/repos/asf/unomi.git.


  at 5a0b714  UNOMI-400 Fix class hierarchy lookup for property condition 
evaluator

This branch includes the following new commits:

 new 5a0b714  UNOMI-400 Fix class hierarchy lookup for property condition 
evaluator

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[unomi] branch master updated: UNOMI-400 Fix class hierarchy lookup for property condition evaluator (#220)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 7b52f7e  UNOMI-400 Fix class hierarchy lookup for property condition 
evaluator (#220)
7b52f7e is described below

commit 7b52f7efe2f9576ae4aac2a991a806c91a1902df
Author: Serge Huber 
AuthorDate: Thu Nov 19 21:31:42 2020 +0100

UNOMI-400 Fix class hierarchy lookup for property condition evaluator (#220)
---
 .../HardcodedPropertyAccessorRegistry.java | 60 --
 .../conditions/accessors/MetadataItemAccessor.java |  2 +-
 .../HardcodedPropertyAccessorRegistryTest.java | 20 
 .../conditions/PropertyConditionEvaluatorTest.java | 29 ---
 4 files changed, 87 insertions(+), 24 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
index 59a70b5..56f8cd5 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -25,6 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * This class contains the registry of all the hardcoded property accessors.
@@ -34,22 +35,23 @@ public class HardcodedPropertyAccessorRegistry {
 
 private static final Logger logger = 
LoggerFactory.getLogger(HardcodedPropertyAccessorRegistry.class.getName());
 
-Map propertyAccessors = new HashMap<>();
+protected Map, HardcodedPropertyAccessor> propertyAccessors = new 
HashMap<>();
+protected Map, List>> cachedClassAncestors = new 
HashMap<>();
 
 public HardcodedPropertyAccessorRegistry() {
-propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
-propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
-propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
-propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemAccessor(this));
-propertyAccessors.put(Event.class.getName(), new EventAccessor(this));
-propertyAccessors.put(Profile.class.getName(), new 
ProfileAccessor(this));
-propertyAccessors.put(Consent.class.getName(), new 
ConsentAccessor(this));
-propertyAccessors.put(Session.class.getName(), new 
SessionAccessor(this));
-propertyAccessors.put(Rule.class.getName(), new RuleAccessor(this));
-propertyAccessors.put(Goal.class.getName(), new GoalAccessor(this));
-propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemAccessor(this));
-propertyAccessors.put(Campaign.class.getName(), new 
CampaignAccessor(this));
-propertyAccessors.put(Map.class.getName(), new MapAccessor(this));
+propertyAccessors.put(Item.class, new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class, new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class, new MetadataAccessor(this));
+propertyAccessors.put(TimestampedItem.class, new 
TimestampedItemAccessor(this));
+propertyAccessors.put(Event.class, new EventAccessor(this));
+propertyAccessors.put(Profile.class, new ProfileAccessor(this));
+propertyAccessors.put(Consent.class, new ConsentAccessor(this));
+propertyAccessors.put(Session.class, new SessionAccessor(this));
+propertyAccessors.put(Rule.class, new RuleAccessor(this));
+propertyAccessors.put(Goal.class, new GoalAccessor(this));
+propertyAccessors.put(CustomItem.class, new CustomItemAccessor(this));
+propertyAccessors.put(Campaign.class, new CampaignAccessor(this));
+propertyAccessors.put(Map.class, new MapAccessor(this));
 }
 
 public static class NextTokens {
@@ -115,10 +117,16 @@ public class HardcodedPropertyAccessorRegistry {
 NextTokens nextTokens = getNextTokens(expression);
 List> lookupClasses = new ArrayList<>();
 lookupClasses.add(object.getClass());
-lookupClasses.add(object.getClass().getSuperclass());
-lookupClasses.addAll(Arrays.asList(object.getClass().getInterfaces()));
+List> objectClassAncestors = 
cachedClassAncestors.get(object.getClass());
+if (objectClassAncestors == null) {
+objectClassAncestors = collectAncestors(object.getClass(), 
propertyAccessors.keySet());
+cachedClassAncestors.put(object.getClass(), objectClassAncestors);
+}
+if (objectClassAncestors != nu

[unomi] branch unomi-1.5.x updated: UNOMI-400 Fix class hierarchy lookup for property condition evaluator (#220)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-1.5.x by this push:
 new b2aca6d  UNOMI-400 Fix class hierarchy lookup for property condition 
evaluator (#220)
b2aca6d is described below

commit b2aca6dc532a321cd0b77feb6900e08bce11d51e
Author: Serge Huber 
AuthorDate: Thu Nov 19 21:31:42 2020 +0100

UNOMI-400 Fix class hierarchy lookup for property condition evaluator (#220)

(cherry picked from commit 7b52f7efe2f9576ae4aac2a991a806c91a1902df)
---
 .../HardcodedPropertyAccessorRegistry.java | 60 --
 .../conditions/accessors/MetadataItemAccessor.java |  2 +-
 .../HardcodedPropertyAccessorRegistryTest.java | 20 
 .../conditions/PropertyConditionEvaluatorTest.java | 29 ---
 4 files changed, 87 insertions(+), 24 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
index 59a70b5..56f8cd5 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -25,6 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * This class contains the registry of all the hardcoded property accessors.
@@ -34,22 +35,23 @@ public class HardcodedPropertyAccessorRegistry {
 
 private static final Logger logger = 
LoggerFactory.getLogger(HardcodedPropertyAccessorRegistry.class.getName());
 
-Map propertyAccessors = new HashMap<>();
+protected Map, HardcodedPropertyAccessor> propertyAccessors = new 
HashMap<>();
+protected Map, List>> cachedClassAncestors = new 
HashMap<>();
 
 public HardcodedPropertyAccessorRegistry() {
-propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
-propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
-propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
-propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemAccessor(this));
-propertyAccessors.put(Event.class.getName(), new EventAccessor(this));
-propertyAccessors.put(Profile.class.getName(), new 
ProfileAccessor(this));
-propertyAccessors.put(Consent.class.getName(), new 
ConsentAccessor(this));
-propertyAccessors.put(Session.class.getName(), new 
SessionAccessor(this));
-propertyAccessors.put(Rule.class.getName(), new RuleAccessor(this));
-propertyAccessors.put(Goal.class.getName(), new GoalAccessor(this));
-propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemAccessor(this));
-propertyAccessors.put(Campaign.class.getName(), new 
CampaignAccessor(this));
-propertyAccessors.put(Map.class.getName(), new MapAccessor(this));
+propertyAccessors.put(Item.class, new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class, new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class, new MetadataAccessor(this));
+propertyAccessors.put(TimestampedItem.class, new 
TimestampedItemAccessor(this));
+propertyAccessors.put(Event.class, new EventAccessor(this));
+propertyAccessors.put(Profile.class, new ProfileAccessor(this));
+propertyAccessors.put(Consent.class, new ConsentAccessor(this));
+propertyAccessors.put(Session.class, new SessionAccessor(this));
+propertyAccessors.put(Rule.class, new RuleAccessor(this));
+propertyAccessors.put(Goal.class, new GoalAccessor(this));
+propertyAccessors.put(CustomItem.class, new CustomItemAccessor(this));
+propertyAccessors.put(Campaign.class, new CampaignAccessor(this));
+propertyAccessors.put(Map.class, new MapAccessor(this));
 }
 
 public static class NextTokens {
@@ -115,10 +117,16 @@ public class HardcodedPropertyAccessorRegistry {
 NextTokens nextTokens = getNextTokens(expression);
 List> lookupClasses = new ArrayList<>();
 lookupClasses.add(object.getClass());
-lookupClasses.add(object.getClass().getSuperclass());
-lookupClasses.addAll(Arrays.asList(object.getClass().getInterfaces()));
+List> objectClassAncestors = 
cachedClassAncestors.get(object.getClass());
+if (objectClassAncestors == null) {
+objectClassAncestors = collectAncestors(object.getClass(), 
propertyAccessors.keySet());
+cachedClassAncestors.put(

[unomi] branch unomi-1.4.x updated: UNOMI-400 Fix class hierarchy lookup for property condition evaluator (#220)

2020-11-19 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.4.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-1.4.x by this push:
 new 92232f1  UNOMI-400 Fix class hierarchy lookup for property condition 
evaluator (#220)
92232f1 is described below

commit 92232f10a9e3edb64ad8fb6bc203b3472983dfd9
Author: Serge Huber 
AuthorDate: Thu Nov 19 21:31:42 2020 +0100

UNOMI-400 Fix class hierarchy lookup for property condition evaluator (#220)

(cherry picked from commit 7b52f7efe2f9576ae4aac2a991a806c91a1902df)
---
 .../HardcodedPropertyAccessorRegistry.java | 60 --
 .../conditions/accessors/MetadataItemAccessor.java |  2 +-
 .../HardcodedPropertyAccessorRegistryTest.java | 20 
 .../conditions/PropertyConditionEvaluatorTest.java | 29 ---
 4 files changed, 87 insertions(+), 24 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
index 59a70b5..56f8cd5 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/HardcodedPropertyAccessorRegistry.java
@@ -25,6 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * This class contains the registry of all the hardcoded property accessors.
@@ -34,22 +35,23 @@ public class HardcodedPropertyAccessorRegistry {
 
 private static final Logger logger = 
LoggerFactory.getLogger(HardcodedPropertyAccessorRegistry.class.getName());
 
-Map propertyAccessors = new HashMap<>();
+protected Map, HardcodedPropertyAccessor> propertyAccessors = new 
HashMap<>();
+protected Map, List>> cachedClassAncestors = new 
HashMap<>();
 
 public HardcodedPropertyAccessorRegistry() {
-propertyAccessors.put(Item.class.getName(), new ItemAccessor(this));
-propertyAccessors.put(MetadataItem.class.getName(), new 
MetadataItemAccessor(this));
-propertyAccessors.put(Metadata.class.getName(), new 
MetadataAccessor(this));
-propertyAccessors.put(TimestampedItem.class.getName(), new 
TimestampedItemAccessor(this));
-propertyAccessors.put(Event.class.getName(), new EventAccessor(this));
-propertyAccessors.put(Profile.class.getName(), new 
ProfileAccessor(this));
-propertyAccessors.put(Consent.class.getName(), new 
ConsentAccessor(this));
-propertyAccessors.put(Session.class.getName(), new 
SessionAccessor(this));
-propertyAccessors.put(Rule.class.getName(), new RuleAccessor(this));
-propertyAccessors.put(Goal.class.getName(), new GoalAccessor(this));
-propertyAccessors.put(CustomItem.class.getName(), new 
CustomItemAccessor(this));
-propertyAccessors.put(Campaign.class.getName(), new 
CampaignAccessor(this));
-propertyAccessors.put(Map.class.getName(), new MapAccessor(this));
+propertyAccessors.put(Item.class, new ItemAccessor(this));
+propertyAccessors.put(MetadataItem.class, new 
MetadataItemAccessor(this));
+propertyAccessors.put(Metadata.class, new MetadataAccessor(this));
+propertyAccessors.put(TimestampedItem.class, new 
TimestampedItemAccessor(this));
+propertyAccessors.put(Event.class, new EventAccessor(this));
+propertyAccessors.put(Profile.class, new ProfileAccessor(this));
+propertyAccessors.put(Consent.class, new ConsentAccessor(this));
+propertyAccessors.put(Session.class, new SessionAccessor(this));
+propertyAccessors.put(Rule.class, new RuleAccessor(this));
+propertyAccessors.put(Goal.class, new GoalAccessor(this));
+propertyAccessors.put(CustomItem.class, new CustomItemAccessor(this));
+propertyAccessors.put(Campaign.class, new CampaignAccessor(this));
+propertyAccessors.put(Map.class, new MapAccessor(this));
 }
 
 public static class NextTokens {
@@ -115,10 +117,16 @@ public class HardcodedPropertyAccessorRegistry {
 NextTokens nextTokens = getNextTokens(expression);
 List> lookupClasses = new ArrayList<>();
 lookupClasses.add(object.getClass());
-lookupClasses.add(object.getClass().getSuperclass());
-lookupClasses.addAll(Arrays.asList(object.getClass().getInterfaces()));
+List> objectClassAncestors = 
cachedClassAncestors.get(object.getClass());
+if (objectClassAncestors == null) {
+objectClassAncestors = collectAncestors(object.getClass(), 
propertyAccessors.keySet());
+cachedClassAncestors.put(

[unomi] branch unomi-1.5.x updated: [maven-release-plugin] prepare release unomi-root-1.5.4

2020-11-21 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-1.5.x by this push:
 new fbfe121  [maven-release-plugin] prepare release unomi-root-1.5.4
fbfe121 is described below

commit fbfe1212cfc3f864581ae0f7e03bb5918c145da0
Author: Serge Huber 
AuthorDate: Sat Nov 21 18:22:06 2020 +0100

[maven-release-plugin] prepare release unomi-root-1.5.4
---
 api/pom.xml   | 2 +-
 common/pom.xml| 4 ++--
 docker/pom.xml| 2 +-
 extensions/geonames/pom.xml   | 2 +-
 extensions/geonames/rest/pom.xml  | 2 +-
 extensions/geonames/services/pom.xml  | 2 +-
 extensions/groovy-actions/karaf-kar/pom.xml   | 2 +-
 extensions/groovy-actions/pom.xml | 2 +-
 extensions/groovy-actions/services/pom.xml| 2 +-
 extensions/lists-extension/actions/pom.xml| 2 +-
 extensions/lists-extension/pom.xml| 2 +-
 extensions/lists-extension/rest/pom.xml   | 2 +-
 extensions/lists-extension/services/pom.xml   | 2 +-
 extensions/pom.xml| 2 +-
 extensions/privacy-extension/pom.xml  | 2 +-
 extensions/privacy-extension/rest/pom.xml | 2 +-
 extensions/privacy-extension/services/pom.xml | 4 ++--
 extensions/router/pom.xml | 2 +-
 extensions/router/router-api/pom.xml  | 2 +-
 extensions/router/router-core/pom.xml | 2 +-
 extensions/router/router-karaf-feature/pom.xml| 2 +-
 extensions/router/router-rest/pom.xml | 2 +-
 extensions/router/router-service/pom.xml  | 2 +-
 extensions/salesforce-connector/actions/pom.xml   | 2 +-
 extensions/salesforce-connector/karaf-kar/pom.xml | 2 +-
 extensions/salesforce-connector/pom.xml   | 2 +-
 extensions/salesforce-connector/rest/pom.xml  | 2 +-
 extensions/salesforce-connector/services/pom.xml  | 2 +-
 extensions/unomi-mailchimp/actions/pom.xml| 2 +-
 extensions/unomi-mailchimp/karaf-kar/pom.xml  | 2 +-
 extensions/unomi-mailchimp/pom.xml| 2 +-
 extensions/unomi-mailchimp/rest/pom.xml   | 2 +-
 extensions/unomi-mailchimp/services/pom.xml   | 2 +-
 extensions/weather-update/core/pom.xml| 2 +-
 extensions/weather-update/karaf-kar/pom.xml   | 2 +-
 extensions/weather-update/pom.xml | 2 +-
 extensions/web-tracker/javascript/pom.xml | 2 +-
 extensions/web-tracker/karaf-kar/pom.xml  | 2 +-
 extensions/web-tracker/pom.xml| 2 +-
 extensions/web-tracker/wab/pom.xml| 2 +-
 itests/pom.xml| 2 +-
 kar/pom.xml   | 2 +-
 lifecycle-watcher/pom.xml | 2 +-
 manual/pom.xml| 2 +-
 metrics/pom.xml   | 2 +-
 package/pom.xml   | 2 +-
 performance-tests/pom.xml | 2 +-
 persistence-elasticsearch/core/pom.xml| 2 +-
 persistence-elasticsearch/pom.xml | 2 +-
 persistence-spi/pom.xml   | 2 +-
 plugins/baseplugin/pom.xml| 2 +-
 plugins/hover-event/pom.xml   | 2 +-
 plugins/kafka-injector/pom.xml| 2 +-
 plugins/mail/pom.xml  | 2 +-
 plugins/optimization-test/pom.xml | 2 +-
 plugins/past-event/pom.xml| 2 +-
 plugins/pom.xml   | 2 +-
 plugins/request/pom.xml   | 2 +-
 plugins/tracked-event/pom.xml | 2 +-
 pom.xml   | 4 ++--
 rest/pom.xml  | 2 +-
 samples/groovy-actions/pom.xml| 2 +-
 samples/login-integration/pom.xml | 2 +-
 samples/pom.xml   | 2 +-
 samples/trainingplugin/pom.xml| 4 ++--
 samples/tweet-button-plugin/pom.xml   | 2 +-
 scripting/pom.xml | 4 ++--
 services/pom.xml  | 2 +-
 tools/pom.xml | 2 +-
 tools/shell-commands/pom.xml  | 2 +-
 tools/shell-dev-commands/pom.xml  | 2 +-
 wab/pom.xml   | 2 +-
 72 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/api/pom.xml b/api/pom.xml
index a27625c..dadf8f5 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -22,7 +22,7 @@
 
 org.apache.unomi
 unomi-root
-1.5.4-SNAPSHOT
+1.5.4

[unomi] annotated tag unomi-root-1.5.4 created (now 56933f6)

2020-11-21 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to annotated tag unomi-root-1.5.4
in repository https://gitbox.apache.org/repos/asf/unomi.git.


  at 56933f6  (tag)
 tagging fbfe1212cfc3f864581ae0f7e03bb5918c145da0 (commit)
 replaces unomi-root-1.5.3
  by Serge Huber
  on Sat Nov 21 18:22:12 2020 +0100

- Log -
[maven-release-plugin] copy for tag unomi-root-1.5.4
---

No new revisions were added by this update.



[unomi] branch unomi-1.5.x updated: [maven-release-plugin] prepare for next development iteration

2020-11-21 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-1.5.x by this push:
 new eb6c2b1  [maven-release-plugin] prepare for next development iteration
eb6c2b1 is described below

commit eb6c2b118a865b34bb18c3e5091ed67f9387daf2
Author: Serge Huber 
AuthorDate: Sat Nov 21 18:22:18 2020 +0100

[maven-release-plugin] prepare for next development iteration
---
 api/pom.xml   | 2 +-
 common/pom.xml| 4 ++--
 docker/pom.xml| 2 +-
 extensions/geonames/pom.xml   | 2 +-
 extensions/geonames/rest/pom.xml  | 2 +-
 extensions/geonames/services/pom.xml  | 2 +-
 extensions/groovy-actions/karaf-kar/pom.xml   | 2 +-
 extensions/groovy-actions/pom.xml | 2 +-
 extensions/groovy-actions/services/pom.xml| 2 +-
 extensions/lists-extension/actions/pom.xml| 2 +-
 extensions/lists-extension/pom.xml| 2 +-
 extensions/lists-extension/rest/pom.xml   | 2 +-
 extensions/lists-extension/services/pom.xml   | 2 +-
 extensions/pom.xml| 2 +-
 extensions/privacy-extension/pom.xml  | 2 +-
 extensions/privacy-extension/rest/pom.xml | 2 +-
 extensions/privacy-extension/services/pom.xml | 4 ++--
 extensions/router/pom.xml | 2 +-
 extensions/router/router-api/pom.xml  | 2 +-
 extensions/router/router-core/pom.xml | 2 +-
 extensions/router/router-karaf-feature/pom.xml| 2 +-
 extensions/router/router-rest/pom.xml | 2 +-
 extensions/router/router-service/pom.xml  | 2 +-
 extensions/salesforce-connector/actions/pom.xml   | 2 +-
 extensions/salesforce-connector/karaf-kar/pom.xml | 2 +-
 extensions/salesforce-connector/pom.xml   | 2 +-
 extensions/salesforce-connector/rest/pom.xml  | 2 +-
 extensions/salesforce-connector/services/pom.xml  | 2 +-
 extensions/unomi-mailchimp/actions/pom.xml| 2 +-
 extensions/unomi-mailchimp/karaf-kar/pom.xml  | 2 +-
 extensions/unomi-mailchimp/pom.xml| 2 +-
 extensions/unomi-mailchimp/rest/pom.xml   | 2 +-
 extensions/unomi-mailchimp/services/pom.xml   | 2 +-
 extensions/weather-update/core/pom.xml| 2 +-
 extensions/weather-update/karaf-kar/pom.xml   | 2 +-
 extensions/weather-update/pom.xml | 2 +-
 extensions/web-tracker/javascript/pom.xml | 2 +-
 extensions/web-tracker/karaf-kar/pom.xml  | 2 +-
 extensions/web-tracker/pom.xml| 2 +-
 extensions/web-tracker/wab/pom.xml| 2 +-
 itests/pom.xml| 2 +-
 kar/pom.xml   | 2 +-
 lifecycle-watcher/pom.xml | 2 +-
 manual/pom.xml| 2 +-
 metrics/pom.xml   | 2 +-
 package/pom.xml   | 2 +-
 performance-tests/pom.xml | 2 +-
 persistence-elasticsearch/core/pom.xml| 2 +-
 persistence-elasticsearch/pom.xml | 2 +-
 persistence-spi/pom.xml   | 2 +-
 plugins/baseplugin/pom.xml| 2 +-
 plugins/hover-event/pom.xml   | 2 +-
 plugins/kafka-injector/pom.xml| 2 +-
 plugins/mail/pom.xml  | 2 +-
 plugins/optimization-test/pom.xml | 2 +-
 plugins/past-event/pom.xml| 2 +-
 plugins/pom.xml   | 2 +-
 plugins/request/pom.xml   | 2 +-
 plugins/tracked-event/pom.xml | 2 +-
 pom.xml   | 4 ++--
 rest/pom.xml  | 2 +-
 samples/groovy-actions/pom.xml| 2 +-
 samples/login-integration/pom.xml | 2 +-
 samples/pom.xml   | 2 +-
 samples/trainingplugin/pom.xml| 4 ++--
 samples/tweet-button-plugin/pom.xml   | 2 +-
 scripting/pom.xml | 4 ++--
 services/pom.xml  | 2 +-
 tools/pom.xml | 2 +-
 tools/shell-commands/pom.xml  | 2 +-
 tools/shell-dev-commands/pom.xml  | 2 +-
 wab/pom.xml   | 2 +-
 72 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/api/pom.xml b/api/pom.xml
index dadf8f5..babf75c 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -22,7 +22,7 @@
 
 org.apache.unomi
 unomi-root
-1.5.4
+1.5.5-SNAPSHOT

[unomi] 01/01: UNOMI-400 Update documentation to reflect the latest config changes

2020-11-23 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-400-update-documentation
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit e7329689fd7002d687d181152e019ca727762152
Author: Serge Huber 
AuthorDate: Mon Nov 23 15:59:52 2020 +0100

UNOMI-400 Update documentation to reflect the latest config changes
---
 .../src/archives/1.5/asciidoc/configuration.adoc   | 22 +++---
 manual/src/main/asciidoc/configuration.adoc| 22 +++---
 2 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/manual/src/archives/1.5/asciidoc/configuration.adoc 
b/manual/src/archives/1.5/asciidoc/configuration.adoc
index f2b7a8c..c103d64 100644
--- a/manual/src/archives/1.5/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.5/asciidoc/configuration.adoc
@@ -353,13 +353,21 @@ 
org.apache.unomi.scripting.filter.activated=${env:UNOMI_SCRIPTING_FILTER_ACTIVAT
 # The following parameters control the filtering using regular expressions for 
each scripting sub-system.
 # The "collections" parameter tells the expression filtering system which 
configurations to expect. By default only MVEL and/or OGNL are accepted values, 
but in the future these might be replaced by new scripting sub-systems.
 
org.apache.unomi.scripting.filter.collections=${env:UNOMI_SCRIPTING_FILTER_COLLECTIONS:-mvel,ognl}
-# For each scripting sub-system, there is an allow and a forbid value. It is 
NOT recommended to change the built-in "forbid" value unless you are having 
issues with its value.
-# It is however fully expected to add new expressions to the "allow" value, 
although it is better to add them inside any plugins you may be adding. This 
configuration is only designed to compensate for the cases where something was 
not properly designed or to deal with compatibility issues. Just be VERY 
careful to make your patterns AS SPECIFIC AS POSSIBLE in order to avoid 
introducing a way to abuse the expression filtering.
-org.apache.unomi.scripting.filter.collections=${env:UNOMI_SCRIPTING_FILTER_COLLECTIONS:-mvel,ognl}
-org.apache.unomi.scripting.filter.mvel.allow=${env:UNOMI_SCRIPTING_FILTER_MVEL_ALLOW:-}
-# 
org.apache.unomi.scripting.filter.mvel.forbid=${env:UNOMI_SCRIPTING_FILTER_MVEL_FORBID:-.*Runtime.*,.*ProcessBuilder.*,.*exec.*,.*invoke.*,.*getClass.*,.*Class.*,.*ClassLoader.*,.*System.*,.*Method.*,.*method.*,.*Compiler.*,.*Thread.*,.*FileWriter.*,.*forName.*,.*Socket.*,.*DriverManager.*,eval}
-org.apache.unomi.scripting.filter.ognl.allow=${env:UNOMI_SCRIPTING_FILTER_OGNL_ALLOW:-}
-# 
org.apache.unomi.scripting.filter.ognl.forbid=${env:UNOMI_SCRIPTING_FILTER_OGNL_FORBID:-.*Runtime.*,.*ProcessBuilder.*,.*exec.*,.*invoke.*,.*getClass.*,.*Class.*,.*ClassLoader.*,.*System.*,.*Method.*,.*method.*,.*Compiler.*,.*Thread.*,.*FileWriter.*,.*forName.*,.*Socket.*,.*DriverManager.*,eval}
+
+# For each scripting sub-system, there is an allow and a forbid property that 
reference a .json files,
+# you can either edit this files or reference your own file directly in the 
following config.
+# Note: You can add new expressions to the "allow" file, although it is better 
to add them inside any plugins you may be adding.
+#   This configuration is only designed to compensate for the cases where 
something was not properly designed or to deal with compatibility issues.
+#   Just be VERY careful to make your patterns AS SPECIFIC AS POSSIBLE in 
order to avoid introducing a way to abuse the expression filtering.
+# Note: It is NOT recommended to change the built-in "forbid" value unless you 
are having issues with its value.
+# Note: mvel-allow.json contains an empty array: [], this mean nothing is 
allowed, so far.
+#   If you want to allow all expression, just remove the property 
org.apache.unomi.scripting.filter.mvel.allow, but this is not recommended
+#   It's better to list your expressions, and provide them in the 
mvel-allow.json file
+#   example: ["\\Qsession.size + 1\\E"]
+org.apache.unomi.scripting.filter.mvel.allow=${env:UNOMI_SCRIPTING_FILTER_MVEL_ALLOW:-${karaf.etc}/mvel-allow.json}
+org.apache.unomi.scripting.filter.mvel.forbid=${env:UNOMI_SCRIPTING_FILTER_MVEL_FORBID:-${karaf.etc}/mvel-forbid.json}
+org.apache.unomi.scripting.filter.ognl.allow=${env:UNOMI_SCRIPTING_FILTER_OGNL_ALLOW:-${karaf.etc}/ognl-allow.json}
+org.apache.unomi.scripting.filter.ognl.forbid=${env:UNOMI_SCRIPTING_FILTER_OGNL_FORBID:-${karaf.etc}/ognl-forbid.json}
 
 # This parameter controls whether OGNL scripting is allowed in expressions. 
Because of security reasons it is deactivated by default. If you run into 
compatibility issues you could reactivate it but it is at your own risk.
 
org.apache.unomi.security.properties.useOGNLScripting=${env:UNOMI_SCRIPTING_USE_OGNL:-false}
diff --git a/manual/src/main/asciidoc/configuration.adoc 
b/manual/src/main/asciidoc/configuration.

[unomi] branch UNOMI-400-update-documentation created (now e732968)

2020-11-23 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch UNOMI-400-update-documentation
in repository https://gitbox.apache.org/repos/asf/unomi.git.


  at e732968  UNOMI-400 Update documentation to reflect the latest config 
changes

This branch includes the following new commits:

 new e732968  UNOMI-400 Update documentation to reflect the latest config 
changes

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[unomi] branch master updated: UNOMI-400 Update documentation to reflect the latest config changes (#221)

2020-11-23 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 491700c  UNOMI-400 Update documentation to reflect the latest config 
changes (#221)
491700c is described below

commit 491700c9f24154d92afe1921171b33ab0d18ecd0
Author: Serge Huber 
AuthorDate: Mon Nov 23 16:41:12 2020 +0100

UNOMI-400 Update documentation to reflect the latest config changes (#221)
---
 .../src/archives/1.5/asciidoc/configuration.adoc   | 22 +++---
 manual/src/main/asciidoc/configuration.adoc| 22 +++---
 2 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/manual/src/archives/1.5/asciidoc/configuration.adoc 
b/manual/src/archives/1.5/asciidoc/configuration.adoc
index f2b7a8c..c103d64 100644
--- a/manual/src/archives/1.5/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.5/asciidoc/configuration.adoc
@@ -353,13 +353,21 @@ 
org.apache.unomi.scripting.filter.activated=${env:UNOMI_SCRIPTING_FILTER_ACTIVAT
 # The following parameters control the filtering using regular expressions for 
each scripting sub-system.
 # The "collections" parameter tells the expression filtering system which 
configurations to expect. By default only MVEL and/or OGNL are accepted values, 
but in the future these might be replaced by new scripting sub-systems.
 
org.apache.unomi.scripting.filter.collections=${env:UNOMI_SCRIPTING_FILTER_COLLECTIONS:-mvel,ognl}
-# For each scripting sub-system, there is an allow and a forbid value. It is 
NOT recommended to change the built-in "forbid" value unless you are having 
issues with its value.
-# It is however fully expected to add new expressions to the "allow" value, 
although it is better to add them inside any plugins you may be adding. This 
configuration is only designed to compensate for the cases where something was 
not properly designed or to deal with compatibility issues. Just be VERY 
careful to make your patterns AS SPECIFIC AS POSSIBLE in order to avoid 
introducing a way to abuse the expression filtering.
-org.apache.unomi.scripting.filter.collections=${env:UNOMI_SCRIPTING_FILTER_COLLECTIONS:-mvel,ognl}
-org.apache.unomi.scripting.filter.mvel.allow=${env:UNOMI_SCRIPTING_FILTER_MVEL_ALLOW:-}
-# 
org.apache.unomi.scripting.filter.mvel.forbid=${env:UNOMI_SCRIPTING_FILTER_MVEL_FORBID:-.*Runtime.*,.*ProcessBuilder.*,.*exec.*,.*invoke.*,.*getClass.*,.*Class.*,.*ClassLoader.*,.*System.*,.*Method.*,.*method.*,.*Compiler.*,.*Thread.*,.*FileWriter.*,.*forName.*,.*Socket.*,.*DriverManager.*,eval}
-org.apache.unomi.scripting.filter.ognl.allow=${env:UNOMI_SCRIPTING_FILTER_OGNL_ALLOW:-}
-# 
org.apache.unomi.scripting.filter.ognl.forbid=${env:UNOMI_SCRIPTING_FILTER_OGNL_FORBID:-.*Runtime.*,.*ProcessBuilder.*,.*exec.*,.*invoke.*,.*getClass.*,.*Class.*,.*ClassLoader.*,.*System.*,.*Method.*,.*method.*,.*Compiler.*,.*Thread.*,.*FileWriter.*,.*forName.*,.*Socket.*,.*DriverManager.*,eval}
+
+# For each scripting sub-system, there is an allow and a forbid property that 
reference a .json files,
+# you can either edit this files or reference your own file directly in the 
following config.
+# Note: You can add new expressions to the "allow" file, although it is better 
to add them inside any plugins you may be adding.
+#   This configuration is only designed to compensate for the cases where 
something was not properly designed or to deal with compatibility issues.
+#   Just be VERY careful to make your patterns AS SPECIFIC AS POSSIBLE in 
order to avoid introducing a way to abuse the expression filtering.
+# Note: It is NOT recommended to change the built-in "forbid" value unless you 
are having issues with its value.
+# Note: mvel-allow.json contains an empty array: [], this mean nothing is 
allowed, so far.
+#   If you want to allow all expression, just remove the property 
org.apache.unomi.scripting.filter.mvel.allow, but this is not recommended
+#   It's better to list your expressions, and provide them in the 
mvel-allow.json file
+#   example: ["\\Qsession.size + 1\\E"]
+org.apache.unomi.scripting.filter.mvel.allow=${env:UNOMI_SCRIPTING_FILTER_MVEL_ALLOW:-${karaf.etc}/mvel-allow.json}
+org.apache.unomi.scripting.filter.mvel.forbid=${env:UNOMI_SCRIPTING_FILTER_MVEL_FORBID:-${karaf.etc}/mvel-forbid.json}
+org.apache.unomi.scripting.filter.ognl.allow=${env:UNOMI_SCRIPTING_FILTER_OGNL_ALLOW:-${karaf.etc}/ognl-allow.json}
+org.apache.unomi.scripting.filter.ognl.forbid=${env:UNOMI_SCRIPTING_FILTER_OGNL_FORBID:-${karaf.etc}/ognl-forbid.json}
 
 # This parameter controls whether OGNL scripting is allowed in expressions. 
Because of security reasons it is deactivated by default. If you run into 
compatibility issues you could reactivate it but it is at your own risk.
 
org.apache.unomi.security.

[unomi-site] branch master updated: Update web site for release 1.5.4

2020-11-23 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new a63e39f  Update web site for release 1.5.4
a63e39f is described below

commit a63e39fcea58538d16937a7fe9dd8e4428f21b50
Author: Serge Huber 
AuthorDate: Mon Nov 23 20:55:05 2020 +0100

Update web site for release 1.5.4
---
 README.md |   9 +-
 pom.xml   |  22 -
 src/main/webapp/contribute-release-guide.html | 118 --
 src/main/webapp/documentation.html|   8 +-
 src/main/webapp/download.html | 106 ---
 src/main/webapp/index.html|   3 +
 6 files changed, 200 insertions(+), 66 deletions(-)

diff --git a/README.md b/README.md
index 9b71448..b3d30cc 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,8 @@
 Apache Unomi Website source repository
 ==
 
-This project contains the Apache Unomi Website.
+This project contains the Apache Unomi Website. The website is generated using 
Maven filtering (for version numbers) and
+then is passed to Jenkins to build the pages using templates.
 
 ## Build
 
@@ -36,14 +37,14 @@ mvn install scm-publish:publish-scm 
-Dusername=YOUR_APACHE_USERNAME -Dpassword=Y
 mvn install
 `
 
-## Jekyll serve
+## Jekyll serve (from source)
 
 `
-mvn gem:exec@jekyll-serve
+mvn gem:exec@jekyll-serve-source
 `
 
 Note: the Jekyll serve will not filter the files so you will still see 
property references such as ${latest.stable.version}.
-This is by design. If you want to see a final version you need to generate it 
using the `mvn clean install` command.
+This is by design. If you want to see a final version you need to generate it 
using the `mvn clean install gem:exec@jekyll-serve-filtered` command.
 
 It works as expected on Mac and Linux, but not on Windows the following 
stacktrace appears:
 
diff --git a/pom.xml b/pom.xml
index 71b3c1e..62989f7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,7 +46,9 @@
 
 
 
-1.5.1
+1.5.4
+1.5.5
+1.5.5-SNAPSHOT
 2.0.0-SNAPSHOT
 
 
@@ -228,8 +230,8 @@
 
 
 
-
-jekyll-serve
+
+jekyll-serve-source
 
 exec
 
@@ -241,6 +243,20 @@
 
 none
 
+
+
+jekyll-serve-filtered
+
+exec
+
+
+
${project.build.directory}/rubygems/bin/jekyll
+serve --trace --source 
${project.build.directory}/filtered-webapp --destination
+${project.build.directory}/generated-jekyll
+
+
+compile
+
 
 
 true
diff --git a/src/main/webapp/contribute-release-guide.html 
b/src/main/webapp/contribute-release-guide.html
index e599933..177aa38 100644
--- a/src/main/webapp/contribute-release-guide.html
+++ b/src/main/webapp/contribute-release-guide.html
@@ -119,12 +119,17 @@ gpg --verify test.txt.asc test.txt
 git clone 
https://gitbox.apache.org/repos/asf/unomi.git
  in a separate directory, to make sure you don’t have any 
additional files in the build
   (such as allCountries.zip or other binary files that should 
not be there)
-Create a new branch if needed for the release using:
+
+Simply checkout an existing branch for release
 cd unomi
-git checkout -b unomi-1.5.x
+git checkout unomi-1.5.x
+
+
+OR Create a new branch if needed for the release using:
+cd unomi
+git checkout -b unomi-1.5.x
 
 
-
 
 
 Build the project
@@ -139,7 +144,7 @@ gpg --verify test.txt.asc test.txt
 mvn clean install 
-DskipITs=true -DskipTests=true -P 
integration-tests,performance-tests,rat,apache-release,docker,\!run-tests
   
   Check that there are no JARs or ZIP files in the source 
code, you can do this by looking at the generated RAT report here :
-less 
target/unomi-root-${latest.development.version}.rat
+less 
target/unomi-root-${next.development.version}.rat

[unomi-site] branch master updated: Fix small issue in phases

2020-11-23 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new 498c3d0  Fix small issue in phases
498c3d0 is described below

commit 498c3d0290c5eaef5fc7b51456b849a53a16f06f
Author: Serge Huber 
AuthorDate: Tue Nov 24 08:02:20 2020 +0100

Fix small issue in phases
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 62989f7..23c89f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -255,7 +255,7 @@
 ${project.build.directory}/generated-jekyll
 
 
-compile
+none
 
 
 



[unomi] branch unomi-1.5.x updated: Add branch information in main README

2020-11-24 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-1.5.x by this push:
 new d2764bc  Add branch information in main README
d2764bc is described below

commit d2764bcb7c103f815ae7662b8944c058522077d4
Author: Serge Huber 
AuthorDate: Tue Nov 24 13:38:09 2020 +0100

Add branch information in main README
---
 README.md | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/README.md b/README.md
index 7d00590..9c2fca5 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,7 @@
 
 Apache Unomi
 
+https://unomi.apache.org
 
 Apache Unomi stores user profile information and is mostly used to provide a 
backend server for A/B testing and 
 personalization. To do so it implements the currently under development OASIS 
Context Server specification. 
@@ -29,6 +30,15 @@ License
 ---
 The source code is available under the Apache License V2
 
+Branches
+
+
+- main (master) branch: is the current development branch and should be 
considered unstable. At this it might even not 
+  compile. It is only recommended for Unomi developers or people looking to 
contribute on the project.
+- unomi-X.X.X branches : these are the maintenance branches of the stable 
releases of Apache Unomi and should always
+compile and be stable. These are recommended for users that prefer to work 
from the source code. Otherwise you can find 
+packaged binaries on the [Apache Unomi website](https://unomi.apache.org). 
+
 Documentation
 -
 You can find all the updated documentation, including building and deployment 
instructions, on the [Apache Unomi 



[unomi] branch master updated: Add branch information in main README

2020-11-24 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new a97481b  Add branch information in main README
a97481b is described below

commit a97481bd6141d7e4c2850c89a9ef0886c7463ded
Author: Serge Huber 
AuthorDate: Tue Nov 24 13:38:09 2020 +0100

Add branch information in main README
---
 README.md | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/README.md b/README.md
index 7d00590..9c2fca5 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,7 @@
 
 Apache Unomi
 
+https://unomi.apache.org
 
 Apache Unomi stores user profile information and is mostly used to provide a 
backend server for A/B testing and 
 personalization. To do so it implements the currently under development OASIS 
Context Server specification. 
@@ -29,6 +30,15 @@ License
 ---
 The source code is available under the Apache License V2
 
+Branches
+
+
+- main (master) branch: is the current development branch and should be 
considered unstable. At this it might even not 
+  compile. It is only recommended for Unomi developers or people looking to 
contribute on the project.
+- unomi-X.X.X branches : these are the maintenance branches of the stable 
releases of Apache Unomi and should always
+compile and be stable. These are recommended for users that prefer to work 
from the source code. Otherwise you can find 
+packaged binaries on the [Apache Unomi website](https://unomi.apache.org). 
+
 Documentation
 -
 You can find all the updated documentation, including building and deployment 
instructions, on the [Apache Unomi 



[unomi] branch master updated: Fix Jenkins files

2020-11-24 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 2b93e02  Fix Jenkins files
2b93e02 is described below

commit 2b93e0281b816f00897b8a9cb7515a9e29cbc223
Author: Serge Huber 
AuthorDate: Tue Nov 24 13:45:50 2020 +0100

Fix Jenkins files
---
 Jenkinsfile   | 4 ++--
 Jenkinsfile-jdk11 | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 288dd9e..37620f4 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -35,8 +35,8 @@ pipeline {
 
 tools {
 // ... tell Jenkins what java version, maven version or other tools 
are required ...
-maven 'Maven 3 (latest)'
-jdk 'JDK 1.8 (latest)'
+maven 'maven_3_latest'
+jdk 'jdk_1.8_latest'
 }
 
 options {
diff --git a/Jenkinsfile-jdk11 b/Jenkinsfile-jdk11
index 7f7c07a..b69 100644
--- a/Jenkinsfile-jdk11
+++ b/Jenkinsfile-jdk11
@@ -35,8 +35,8 @@ pipeline {
 
 tools {
 // ... tell Jenkins what java version, maven version or other tools 
are required ...
-maven 'Maven 3 (latest)'
-jdk 'JDK 11 (latest)'
+maven 'maven_3_latest'
+jdk 'jdk_11_latest'
 }
 
 options {



[unomi] branch unomi-1.5.x updated: Fix Jenkins files

2020-11-24 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-1.5.x by this push:
 new 77cc70d  Fix Jenkins files
77cc70d is described below

commit 77cc70df8997bc6ce4da2559239e5d873942
Author: Serge Huber 
AuthorDate: Tue Nov 24 13:45:50 2020 +0100

Fix Jenkins files

(cherry picked from commit 2b93e0281b816f00897b8a9cb7515a9e29cbc223)
---
 Jenkinsfile   | 4 ++--
 Jenkinsfile-jdk11 | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 288dd9e..37620f4 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -35,8 +35,8 @@ pipeline {
 
 tools {
 // ... tell Jenkins what java version, maven version or other tools 
are required ...
-maven 'Maven 3 (latest)'
-jdk 'JDK 1.8 (latest)'
+maven 'maven_3_latest'
+jdk 'jdk_1.8_latest'
 }
 
 options {
diff --git a/Jenkinsfile-jdk11 b/Jenkinsfile-jdk11
index 7f7c07a..b69 100644
--- a/Jenkinsfile-jdk11
+++ b/Jenkinsfile-jdk11
@@ -35,8 +35,8 @@ pipeline {
 
 tools {
 // ... tell Jenkins what java version, maven version or other tools 
are required ...
-maven 'Maven 3 (latest)'
-jdk 'JDK 11 (latest)'
+maven 'maven_3_latest'
+jdk 'jdk_11_latest'
 }
 
 options {



[unomi-site] branch master updated: Fix typos and add links to new manual packages

2020-11-24 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new 419cbfb  Fix typos and add links to new manual packages
419cbfb is described below

commit 419cbfb12199da51c8363266a1e7920c695046a0
Author: Serge Huber 
AuthorDate: Tue Nov 24 16:54:58 2020 +0100

Fix typos and add links to new manual packages
---
 src/main/webapp/contribute-release-guide.html | 15 +++
 src/main/webapp/documentation.html| 12 ++--
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/src/main/webapp/contribute-release-guide.html 
b/src/main/webapp/contribute-release-guide.html
index 177aa38..a2569c1 100644
--- a/src/main/webapp/contribute-release-guide.html
+++ b/src/main/webapp/contribute-release-guide.html
@@ -329,6 +329,21 @@ mvn install scm-publish:publish-scm 
-Dusername=YOUR_APACHE_USERNAME -Dpassword=Y
 Upload the site modification by using:
 ./generate-site-and-upload.sh APACHE_LDAP_USERNAME 
APACHE_LDAP_PASSWORD
   
+
+You will now need to publish the new version of the manual 
as downloadable resources
+cd manual
+cd target
+svn co https://dist.apache.org/repos/dist/release/unomi/${next.stable.version}
+mv unomi-manual-1_5_x.pdf ${next.stable.version}
+mv unomi-manual-1_5_x.pdf.asc ${next.stable.version}
+mv unomi-manual-1_5_x.zip ${next.stable.version}
+mv unomi-manual-1_5_x.pdf.sha512 ${next.stable.version}
+mv unomi-manual-1_5_x.zip.asc ${next.stable.version}
+mv unomi-manual-1_5_x.zip.sha512 ${next.stable.version}
+cd ${next.stable.version}
+svn add unomi-manual*
+svn commit -m "Update Unomi manual packages"
+
 
 
 Rollback
diff --git a/src/main/webapp/documentation.html 
b/src/main/webapp/documentation.html
index df99b01..593e6c8 100644
--- a/src/main/webapp/documentation.html
+++ b/src/main/webapp/documentation.html
@@ -17,12 +17,12 @@ layout: default
   Last update: November 23rd, 
2020
   
 online
-https://dist.apache.org/repos/dist/release/unomi/1.5.1/unomi-manual-1_5_x.zip";>html
 (zipped)
-[ https://dist.apache.org/repos/dist/release/unomi/1.5.1/unomi-manual-1_5_x.zip.asc";>PGP
 |
-https://dist.apache.org/repos/dist/release/unomi/1.5.1/unomi-manual-1_5_x.zip.sha512";>SHA512
 ]
-https://dist.apache.org/repos/dist/release/unomi/1.5.1/unomi-manual-1_5_x.pdf";>pdf
-[ https://dist.apache.org/repos/dist/release/unomi/1.5.1/unomi-manual-1_5_x.pdf.asc";>PGP
 |
-https://dist.apache.org/repos/dist/release/unomi/1.5.1/unomi-manual-1_5_x.pdf.sha512";>SHA512
 ]
+https://dist.apache.org/repos/dist/release/unomi/1.5.4/unomi-manual-1_5_x.zip";>html
 (zipped)
+[ https://dist.apache.org/repos/dist/release/unomi/1.5.4/unomi-manual-1_5_x.zip.asc";>PGP
 |
+https://dist.apache.org/repos/dist/release/unomi/1.5.4/unomi-manual-1_5_x.zip.sha512";>SHA512
 ]
+https://dist.apache.org/repos/dist/release/unomi/1.5.4/unomi-manual-1_5_x.pdf";>pdf
+[ https://dist.apache.org/repos/dist/release/unomi/1.5.4/unomi-manual-1_5_x.pdf.asc";>PGP
 |
+https://dist.apache.org/repos/dist/release/unomi/1.5.4/unomi-manual-1_5_x.pdf.sha512";>SHA512
 ]
 -->
   
 



dev@unomi.apache.org

2020-11-24 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 4a001f0  Fix typos &
4a001f0 is described below

commit 4a001f094c814ce783d0c0a57c31fa6f70bcd463
Author: Serge Huber 
AuthorDate: Tue Nov 24 18:32:01 2020 +0100

Fix typos &
---
 manual/src/archives/1.5/asciidoc/configuration.adoc | 4 ++--
 manual/src/main/asciidoc/configuration.adoc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/manual/src/archives/1.5/asciidoc/configuration.adoc 
b/manual/src/archives/1.5/asciidoc/configuration.adoc
index c103d64..f416071 100644
--- a/manual/src/archives/1.5/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.5/asciidoc/configuration.adoc
@@ -226,8 +226,8 @@ Apache Unomi allows using different types of expressions in 
the following subsys
 - context.json filters and personalization queries
 - rule conditions and actions parameters
 
-Apache Unomi uses two integrated scripting languages to provide this 
functionality: OGNL and MVEL
-OGNL is deprecated and is now disabled by default in 1.5.2 as it is little 
used (and replaced by better performing
+Apache Unomi uses two integrated scripting languages to provide this 
functionality: OGNL and MVEL.
+OGNL is deprecated and is now disabled by default since 1.5.2 as it is little 
used (and replaced by better performing
 hardcoded property lookups). MVEL is more commonly used in rule actions as in 
the following example:
 
 From 
https://github.com/apache/unomi/blob/unomi-1.5.x/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionAssigned.json[https://github.com/apache/unomi/blob/unomi-1.5.x/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionAssigned.json]:
diff --git a/manual/src/main/asciidoc/configuration.adoc 
b/manual/src/main/asciidoc/configuration.adoc
index c103d64..f416071 100644
--- a/manual/src/main/asciidoc/configuration.adoc
+++ b/manual/src/main/asciidoc/configuration.adoc
@@ -226,8 +226,8 @@ Apache Unomi allows using different types of expressions in 
the following subsys
 - context.json filters and personalization queries
 - rule conditions and actions parameters
 
-Apache Unomi uses two integrated scripting languages to provide this 
functionality: OGNL and MVEL
-OGNL is deprecated and is now disabled by default in 1.5.2 as it is little 
used (and replaced by better performing
+Apache Unomi uses two integrated scripting languages to provide this 
functionality: OGNL and MVEL.
+OGNL is deprecated and is now disabled by default since 1.5.2 as it is little 
used (and replaced by better performing
 hardcoded property lookups). MVEL is more commonly used in rule actions as in 
the following example:
 
 From 
https://github.com/apache/unomi/blob/unomi-1.5.x/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionAssigned.json[https://github.com/apache/unomi/blob/unomi-1.5.x/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionAssigned.json]:



[unomi] branch master updated: Fix bug in profile service it (#222)

2020-12-04 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new cc1306f  Fix bug in profile service it (#222)
cc1306f is described below

commit cc1306f6b6475ce557bea40ac17f602c8b15587e
Author: liatiusim <62553663+liatiu...@users.noreply.github.com>
AuthorDate: Fri Dec 4 12:18:49 2020 +0200

Fix bug in profile service it (#222)
---
 .../org/apache/unomi/itests/ProfileServiceIT.java  |  9 +++
 .../ElasticSearchPersistenceServiceImpl.java   | 21 
 .../unomi/persistence/spi/PersistenceService.java  | 28 ++
 3 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java 
b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java
index 317c4ff..2d0ad9a 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java
@@ -116,9 +116,9 @@ public class ProfileServiceIT extends BaseIT {
 
 // Relevant only when throwExceptions system property is true
 @Test
-public void testGetProfileWithWrongScrollerIdThrowException() throws 
InterruptedException {
-ElasticSearchPersistenceServiceImpl esPersistenceService = 
(ElasticSearchPersistenceServiceImpl)persistenceService;
-esPersistenceService.setThrowExceptions(true);
+public void testGetProfileWithWrongScrollerIdThrowException() throws 
InterruptedException, NoSuchFieldException, IllegalAccessException {
+boolean throwExceptionCurrent = (boolean) 
persistenceService.getSetting("throwExceptions");
+persistenceService.setSetting("throwExceptions", true);
 
 Query query = new Query();
 query.setLimit(2);
@@ -129,9 +129,10 @@ public class ProfileServiceIT extends BaseIT {
 profileService.search(query, Profile.class);
 fail("search method didn't throw when expected");
 } catch (RuntimeException ex) {
+// Should get here since this scenario should throw exception
 }
 finally {
-esPersistenceService.setThrowExceptions(false);
+persistenceService.setSetting("throwExceptions", 
throwExceptionCurrent);
 }
 }
 
diff --git 
a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
 
b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
index df8fad4..9a1e6b1 100644
--- 
a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
+++ 
b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
@@ -142,6 +142,7 @@ import javax.net.ssl.X509TrustManager;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.lang.reflect.Field;
 import java.net.URL;
 import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
@@ -740,6 +741,26 @@ public class ElasticSearchPersistenceServiceImpl 
implements PersistenceService,
 }
 
 @Override
+public void setSettings(Map settings) throws 
NoSuchFieldException, IllegalAccessException {
+for (Map.Entry setting : settings.entrySet())
+setSetting(setting.getKey(), setting.getValue());
+}
+
+@Override
+public void setSetting(String fieldName, Object value) throws 
NoSuchFieldException, IllegalAccessException {
+Field field = this.getClass().getDeclaredField(fieldName);
+field.set(getClass(), value);
+}
+
+@Override
+public Object getSetting(String fieldName) throws NoSuchFieldException, 
IllegalAccessException {
+Field field = this.getClass().getDeclaredField(fieldName);
+return field.get(getClass());
+}
+
+
+
+@Override
 public  T load(final String itemId, final Class clazz) {
 return load(itemId, null, clazz);
 }
diff --git 
a/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
 
b/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
index 1e81300..2b91b2f 100644
--- 
a/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
+++ 
b/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
@@ -81,6 +81,34 @@ public interface PersistenceService {
  PartialList getAllItems(final Class clazz, int 
offset, int size, String sortBy, String scrollTimeValidity);
 
 /**
+ * Set settings of the persistence service
+ *
+ * @param settings

[unomi-site] branch master updated: Add docker image release instructions

2020-12-04 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new 994d6d8  Add docker image release instructions
994d6d8 is described below

commit 994d6d81a5153cecc4fc48a30a3d38c8d8218044
Author: Serge Huber 
AuthorDate: Fri Dec 4 16:14:55 2020 +0100

Add docker image release instructions
---
 src/main/webapp/contribute-release-guide.html | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/main/webapp/contribute-release-guide.html 
b/src/main/webapp/contribute-release-guide.html
index a2569c1..2510cf9 100644
--- a/src/main/webapp/contribute-release-guide.html
+++ b/src/main/webapp/contribute-release-guide.html
@@ -342,10 +342,30 @@ mv unomi-manual-1_5_x.zip.asc ${next.stable.version}
 mv unomi-manual-1_5_x.zip.sha512 ${next.stable.version}
 cd ${next.stable.version}
 svn add unomi-manual*
-svn commit -m "Update Unomi manual packages"
+svn commit -m "Update Unomi manual packages"
 
 
 
+Docker image
+
+
+
+Checkout the tagged version:
+git checkout 
tags/unomi-root-${next.stable.version}
+
+
+Change to the Docker directory. Make sure you have docker 
running locally (start Docker Desktop for
+example):
+cd 
docker
+
+
+Launch the docker build and push
+mvn clean install
+mvn docker:push
+
+
+
+
 Rollback
 
   Delete the tag:



[unomi] branch master updated: Setup code analysis

2020-12-09 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new a507540  Setup code analysis
a507540 is described below

commit a507540601211e85d41448b2a93f0c8aa8368c10
Author: Serge Huber 
AuthorDate: Wed Dec 9 15:53:50 2020 +0100

Setup code analysis
---
 .github/workflows/codeql-analysis.yml | 67 +++
 1 file changed, 67 insertions(+)

diff --git a/.github/workflows/codeql-analysis.yml 
b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 000..f631368
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,67 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+#  NOTE 
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+  push:
+branches: [ master ]
+  pull_request:
+# The branches below must be a subset of the branches above
+branches: [ master ]
+  schedule:
+- cron: '38 1 * * 0'
+
+jobs:
+  analyze:
+name: Analyze
+runs-on: ubuntu-latest
+
+strategy:
+  fail-fast: false
+  matrix:
+language: [ 'java', 'javascript' ]
+# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 
'python' ]
+# Learn more:
+# 
https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v2
+
+# Initializes the CodeQL tools for scanning.
+- name: Initialize CodeQL
+  uses: github/codeql-action/init@v1
+  with:
+languages: ${{ matrix.language }}
+# If you wish to specify custom queries, you can do so here or in a 
config file.
+# By default, queries listed here will override any specified in a 
config file.
+# Prefix the list here with "+" to use these queries and those in the 
config file.
+# queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+# Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
+# If this step fails, then you should remove it and run the build manually 
(see below)
+- name: Autobuild
+  uses: github/codeql-action/autobuild@v1
+
+# ℹ️ Command-line programs to run using the OS shell.
+# 📚 https://git.io/JvXDl
+
+# ✏️ If the Autobuild fails above, remove it and uncomment the following 
three lines
+#and modify them (or add more) to build your code if your project
+#uses a compiled language
+
+#- run: |
+#   make bootstrap
+#   make release
+
+- name: Perform CodeQL Analysis
+  uses: github/codeql-action/analyze@v1



[unomi] branch master updated: Fix build broken after committing github configuration file.

2020-12-11 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 6cb3eb6  Fix build broken after committing github configuration file.
6cb3eb6 is described below

commit 6cb3eb642ab71c62ef321b068bf47cba354ebcf5
Author: Serge Huber 
AuthorDate: Fri Dec 11 11:10:33 2020 +0100

Fix build broken after committing github configuration file.
---
 pom.xml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pom.xml b/pom.xml
index c0fb0ed..78b0ded 100644
--- a/pom.xml
+++ b/pom.xml
@@ -484,6 +484,8 @@
 **/NOTICE-generated
 **/DEPENDENCIES
 **/target/**/*
+
+**/.github/**/*
 
 **/.git/**/*
 



[unomi] branch pr/223 created (now f81c809)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch pr/223
in repository https://gitbox.apache.org/repos/asf/unomi.git.


  at f81c809  Fix compilation error & other minor improvements

This branch includes the following new commits:

 new f81c809  Fix compilation error & other minor improvements

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[unomi] 01/01: Fix compilation error & other minor improvements

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch pr/223
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit f81c809c3dcc2a273b22ee987f9d9d9bdda1dd34
Author: Serge Huber 
AuthorDate: Tue Jan 5 14:12:57 2021 +0100

Fix compilation error & other minor improvements
---
 .../apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
 
b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
index 5c2ed5b..bcd427e 100644
--- 
a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
+++ 
b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
@@ -96,16 +96,17 @@ public class ProfileServiceWithoutOverwriteIT extends 
BaseIT {
 public void testSaveProfileWithoutOverwriteSavesAfterReload() throws 
InterruptedException {
 Profile profile = setupWithoutOverwriteTests();
 String profileId = profile.getItemId();
-Thread.sleep(4000);
+
+profileService.refresh();
 
 Profile updatedProfile = profileService.load(profileId);
 updatedProfile.setProperty("country", "test2-country");
 profileService.save(updatedProfile);
 
-Thread.sleep(4000);
+profileService.refresh();
 
 Profile profileWithNewCountry = profileService.load(profileId);
-assertEquals(profileWithNewCountry.getProperty("country"), 
"test2-country");
+assertEquals("Country property doesn't have expected value", 
"test2-country", profileWithNewCountry.getProperty("country"));
 }
 
 @Test(expected = RuntimeException.class)
@@ -113,11 +114,11 @@ public class ProfileServiceWithoutOverwriteIT extends 
BaseIT {
 Profile profile = setupWithoutOverwriteTests();
 String profileId = profile.getItemId();
 
-Thread.sleep(4000);
+profileService.refresh();
 
 Profile updatedProfile = profileService.load(profileId);
 updatedProfile.setProperty("country", "test2-country");
-updatedProfile.setMetadata("seq_no", 1L);
+updatedProfile.setSystemMetadata("seq_no", 1L);
 profileService.save(updatedProfile);
 }
 }



[unomi] branch master updated: UNOMI-371 add optional support for optimistic concurrency control (if_seq_no) (#223)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 714a643  UNOMI-371 add optional support for optimistic concurrency 
control (if_seq_no) (#223)
714a643 is described below

commit 714a643efe0e0ccd66f14d4a8cff12545f7f94cd
Author: giladw 
AuthorDate: Tue Jan 5 15:23:55 2021 +0200

UNOMI-371 add optional support for optimistic concurrency control 
(if_seq_no) (#223)
---
 api/src/main/java/org/apache/unomi/api/Item.java   |  10 ++
 .../apache/unomi/services/UserListServiceImpl.java |   2 +-
 .../unomi/privacy/internal/PrivacyServiceImpl.java |   2 +-
 .../itests/ProfileServiceWithoutOverwriteIT.java   | 123 +
 .../ElasticSearchPersistenceServiceImpl.java   | 106 ++
 .../resources/OSGI-INF/blueprint/blueprint.xml |   3 +
 .../org.apache.unomi.persistence.elasticsearch.cfg |   5 +-
 .../unomi/persistence/spi/PersistenceService.java  |  36 +-
 .../actions/MergeProfilesOnPropertyAction.java |   6 +-
 .../unomi/plugins/mail/actions/SendMailAction.java |   2 +-
 .../services/impl/events/EventServiceImpl.java |   2 +-
 .../services/impl/rules/RulesServiceImpl.java  |   2 +-
 .../services/impl/segments/SegmentServiceImpl.java |  12 +-
 13 files changed, 268 insertions(+), 43 deletions(-)

diff --git a/api/src/main/java/org/apache/unomi/api/Item.java 
b/api/src/main/java/org/apache/unomi/api/Item.java
index 72f0ae6..2d5ff71 100644
--- a/api/src/main/java/org/apache/unomi/api/Item.java
+++ b/api/src/main/java/org/apache/unomi/api/Item.java
@@ -21,6 +21,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.Serializable;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -63,6 +64,7 @@ public abstract class Item implements Serializable {
 protected String itemType;
 protected String scope;
 protected Long version;
+protected Map systemMetadata = new HashMap<>();
 
 public Item() {
 this.itemType = getItemType(this.getClass());
@@ -140,4 +142,12 @@ public abstract class Item implements Serializable {
 public void setVersion(Long version) {
 this.version = version;
 }
+
+public Object getSystemMetadata(String key) {
+return systemMetadata.get(key);
+}
+
+public void setSystemMetadata(String key, Object value) {
+systemMetadata.put(key, value);
+}
 }
diff --git 
a/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java
 
b/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java
index dc3bbc8..37ca72e 100644
--- 
a/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java
+++ 
b/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java
@@ -94,7 +94,7 @@ public class UserListServiceImpl implements UserListService {
 if(index != -1){
 ((List) 
profileSystemProperties.get("lists")).remove(index);
 profileSystemProperties.put("lastUpdated", new Date());
-persistenceService.update(p.getItemId(), null, 
Profile.class, "systemProperties", profileSystemProperties);
+persistenceService.update(p, null, Profile.class, 
"systemProperties", profileSystemProperties);
 }
 }
 }
diff --git 
a/extensions/privacy-extension/services/src/main/java/org/apache/unomi/privacy/internal/PrivacyServiceImpl.java
 
b/extensions/privacy-extension/services/src/main/java/org/apache/unomi/privacy/internal/PrivacyServiceImpl.java
index 1675e11..3d3d68d 100644
--- 
a/extensions/privacy-extension/services/src/main/java/org/apache/unomi/privacy/internal/PrivacyServiceImpl.java
+++ 
b/extensions/privacy-extension/services/src/main/java/org/apache/unomi/privacy/internal/PrivacyServiceImpl.java
@@ -137,7 +137,7 @@ public class PrivacyServiceImpl implements PrivacyService {
 persistenceService.save(session);
 List events = 
eventService.searchEvents(session.getItemId(), new String[0], null, 0, -1, 
null).getList();
 for (Event event : events) {
-persistenceService.update(event.getItemId(), 
event.getTimeStamp(), Event.class, "profileId", newProfile.getItemId());
+persistenceService.update(event, event.getTimeStamp(), 
Event.class, "profileId", newProfile.getItemId());
 }
 }
 
diff --git 
a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
 
b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
new file mode 100644
index 000..5c2ed5b

[unomi] branch master updated: UNOMI-371 Fix compilation error & other minor improvements

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new fbfaba2  UNOMI-371 Fix compilation error & other minor improvements
fbfaba2 is described below

commit fbfaba2b8c920264e5a5faebf2c8cc74e606ceb9
Author: Serge Huber 
AuthorDate: Tue Jan 5 14:30:40 2021 +0100

UNOMI-371 Fix compilation error & other minor improvements
---
 .../apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
 
b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
index 5c2ed5b..bcd427e 100644
--- 
a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
+++ 
b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceWithoutOverwriteIT.java
@@ -96,16 +96,17 @@ public class ProfileServiceWithoutOverwriteIT extends 
BaseIT {
 public void testSaveProfileWithoutOverwriteSavesAfterReload() throws 
InterruptedException {
 Profile profile = setupWithoutOverwriteTests();
 String profileId = profile.getItemId();
-Thread.sleep(4000);
+
+profileService.refresh();
 
 Profile updatedProfile = profileService.load(profileId);
 updatedProfile.setProperty("country", "test2-country");
 profileService.save(updatedProfile);
 
-Thread.sleep(4000);
+profileService.refresh();
 
 Profile profileWithNewCountry = profileService.load(profileId);
-assertEquals(profileWithNewCountry.getProperty("country"), 
"test2-country");
+assertEquals("Country property doesn't have expected value", 
"test2-country", profileWithNewCountry.getProperty("country"));
 }
 
 @Test(expected = RuntimeException.class)
@@ -113,11 +114,11 @@ public class ProfileServiceWithoutOverwriteIT extends 
BaseIT {
 Profile profile = setupWithoutOverwriteTests();
 String profileId = profile.getItemId();
 
-Thread.sleep(4000);
+profileService.refresh();
 
 Profile updatedProfile = profileService.load(profileId);
 updatedProfile.setProperty("country", "test2-country");
-updatedProfile.setMetadata("seq_no", 1L);
+updatedProfile.setSystemMetadata("seq_no", 1L);
 profileService.save(updatedProfile);
 }
 }



[unomi] branch master updated: UNOMI-392 Integrate GraphQL v14 field visibility with always true by … (#224)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new e800a34  UNOMI-392 Integrate GraphQL v14 field visibility with always 
true by … (#224)
e800a34 is described below

commit e800a341887ae5135708aaf9a44877d546bd8b1d
Author: Pavel Milkevich 
AuthorDate: Tue Jan 5 16:32:00 2021 +0300

UNOMI-392 Integrate GraphQL v14 field visibility with always true by … 
(#224)

* UNOMI-392 Integrate GraphQL v14 field visibility with always true by 
default

* UNOMI-392 Integrate GraphQL v14 field visibility with always true by 
default
---
 .../providers/GraphQLFieldVisibilityProvider.java  | 29 ++
 .../graphql/schema/GraphQLSchemaProvider.java  | 20 +++
 .../unomi/graphql/schema/GraphQLSchemaUpdater.java | 29 +++---
 .../providers/sample/CDPProviderSample.java| 13 +-
 4 files changed, 86 insertions(+), 5 deletions(-)

diff --git 
a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/providers/GraphQLFieldVisibilityProvider.java
 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/providers/GraphQLFieldVisibilityProvider.java
new file mode 100644
index 000..a835030
--- /dev/null
+++ 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/providers/GraphQLFieldVisibilityProvider.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.graphql.providers;
+
+import graphql.schema.visibility.GraphqlFieldVisibility;
+
+/**
+ *  Provider of {@link GraphqlFieldVisibility} to limit graphql schema fields 
visibility
+ *  More about it here 
https://www.graphql-java.com/documentation/v14/fieldvisibility/
+ */
+public interface GraphQLFieldVisibilityProvider extends GraphQLProvider {
+
+GraphqlFieldVisibility getGraphQLFieldVisibility();
+
+}
diff --git 
a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java
 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java
index 31a23b6..8ea7193 100644
--- 
a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java
+++ 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java
@@ -46,6 +46,7 @@ import 
org.apache.unomi.graphql.fetchers.event.UnomiEventPublisher;
 import org.apache.unomi.graphql.providers.GraphQLAdditionalTypesProvider;
 import org.apache.unomi.graphql.providers.GraphQLCodeRegistryProvider;
 import org.apache.unomi.graphql.providers.GraphQLExtensionsProvider;
+import org.apache.unomi.graphql.providers.GraphQLFieldVisibilityProvider;
 import org.apache.unomi.graphql.providers.GraphQLMutationProvider;
 import org.apache.unomi.graphql.providers.GraphQLQueryProvider;
 import org.apache.unomi.graphql.providers.GraphQLSubscriptionProvider;
@@ -99,6 +100,8 @@ public class GraphQLSchemaProvider {
 
 private final List subscriptionProviders;
 
+private final GraphQLFieldVisibilityProvider fieldVisibilityProvider;
+
 private final GraphQLCodeRegistryProvider codeRegistryProvider;
 
 private final UnomiEventPublisher eventPublisher;
@@ -118,6 +121,7 @@ public class GraphQLSchemaProvider {
 this.mutationProviders = builder.mutationProviders;
 this.subscriptionProviders = builder.subscriptionProviders;
 this.codeRegistryProvider = builder.codeRegistryProvider;
+this.fieldVisibilityProvider = builder.fieldVisibilityProvider;
 }
 
 public GraphQLSchema createSchema() {
@@ -139,6 +143,8 @@ public class GraphQLSchemaProvider {
 
 transformMutations();
 
+configureFieldVisibility();
+
 configureCodeRegister();
 
 final AnnotationsSchemaCreator.Builder annotationsSchema = 
AnnotationsSchemaCreator.newAnnotationsSchema();
@@ -672,6 +678,13 @@ public class GraphQLSchemaProvider {
 }
 }
 
+private void configureFieldVisibility() {
+if (fieldVisibilityProvider != null) {
+graphQLAnnotations.getContainer().ge

[unomi] branch master updated: UNOMI-398: Implement interests increments integration tests (#225)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new c69515f  UNOMI-398: Implement interests increments integration tests 
(#225)
c69515f is described below

commit c69515f527ae714e2d0662e264d806e80fb2b519
Author: anatol-sialitski <53557255+anatol-sialit...@users.noreply.github.com>
AuthorDate: Tue Jan 5 16:33:12 2021 +0300

UNOMI-398: Implement interests increments integration tests (#225)
---
 .../test/java/org/apache/unomi/itests/BasicIT.java |   2 +-
 .../apache/unomi/itests/IncrementInterestsIT.java  | 100 +
 .../META-INF/cxs/actions/incrementInterest.json|   2 +-
 .../META-INF/cxs/rules/incrementInterest.json  |   1 -
 4 files changed, 102 insertions(+), 3 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java 
b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
index 0ae2feb..da0e715 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
@@ -73,7 +73,7 @@ public class BasicIT extends BaseIT {
 private static final String ITEM_ID_SITE = "/test/site";
 private static final String ITEM_TYPE_VISITOR = "VISITOR";
 private static final String ITEM_ID_PAGE_1 = "/test/site/page1";
-private static final String ITEM_TYPE_PAGE = "page";
+protected static final String ITEM_TYPE_PAGE = "page";
 
 private static final String FIRST_NAME = "firstName";
 private static final String LAST_NAME = "lastName";
diff --git 
a/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java 
b/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
index 9ebaa79..ba8ae25 100644
--- a/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
@@ -24,11 +24,18 @@ import java.util.UUID;
 
 import javax.inject.Inject;
 
+import org.apache.unomi.api.CustomItem;
 import org.apache.unomi.api.Event;
+import org.apache.unomi.api.Metadata;
 import org.apache.unomi.api.Profile;
 import org.apache.unomi.api.Topic;
+import org.apache.unomi.api.actions.Action;
+import org.apache.unomi.api.conditions.Condition;
+import org.apache.unomi.api.rules.Rule;
+import org.apache.unomi.api.services.DefinitionsService;
 import org.apache.unomi.api.services.EventService;
 import org.apache.unomi.api.services.ProfileService;
+import org.apache.unomi.api.services.RulesService;
 import org.apache.unomi.api.services.TopicService;
 import org.junit.Assert;
 import org.junit.Test;
@@ -38,6 +45,10 @@ import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerSuite;
 import org.ops4j.pax.exam.util.Filter;
 
+import com.sun.tools.javac.util.List;
+
+import static org.apache.unomi.itests.BasicIT.ITEM_TYPE_PAGE;
+
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerSuite.class)
 public class IncrementInterestsIT
@@ -56,6 +67,14 @@ public class IncrementInterestsIT
 @Filter(timeout = 60)
 protected TopicService topicService;
 
+@Inject
+@Filter(timeout = 60)
+protected RulesService rulesService;
+
+@Inject
+@Filter(timeout = 60)
+protected DefinitionsService definitionsService;
+
 @Test
 @SuppressWarnings("unchecked")
 public void test()
@@ -85,9 +104,90 @@ public class IncrementInterestsIT
 Assert.assertEquals( 0.5, interests.get( topic.getTopicId() ), 
0.0 );
 Assert.assertFalse( interests.containsKey( "unknown" ) );
 }
+else
+{
+throw new IllegalStateException( "Profile was not updated" );
+}
+}
+finally
+{
+topicService.delete( topic.getItemId() );
+profileService.delete( profile.getItemId(), false );
+}
+}
+
+@Test
+@SuppressWarnings("unchecked")
+public void testAction()
+throws InterruptedException
+{
+final Topic topic = createTopic( "topicId" );
+final Profile profile = createProfile();
+
+final Action incrementAction = new Action( 
definitionsService.getActionType( "incrementInterestAction" ) );
+incrementAction.setParameter( "eventInterestProperty", 
"eventProperty::target.properties.interests" );
+
+final Condition condition = new Condition( 
definitionsService.getConditionType( "eventTypeCondition" ) );
+condition.setParameter( "eventTypeId", "view" );
+
+final String itemId = UUID.randomUUID().toString();
+
+final Metadata metadata = new Metada

[unomi] branch master updated: Skip tests in jenkins deploy stage (#227)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 0d6417f  Skip tests in jenkins deploy stage (#227)
0d6417f is described below

commit 0d6417faa5bddc57857d2ea4183403c74e9adb28
Author: MT BENTERKI 
AuthorDate: Tue Jan 5 14:33:59 2021 +0100

Skip tests in jenkins deploy stage (#227)
---
 Jenkinsfile   | 4 ++--
 Jenkinsfile-jdk11 | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 37620f4..e777517 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -116,7 +116,7 @@ pipeline {
 }
 steps {
 echo 'Deploying'
-sh 'mvn deploy'
+sh 'mvn deploy -DskipTests'
 }
 }
 }
@@ -178,4 +178,4 @@ Is back to normal.
 }
 }
 
-}
\ No newline at end of file
+}
diff --git a/Jenkinsfile-jdk11 b/Jenkinsfile-jdk11
index b69..dd3f5d2 100644
--- a/Jenkinsfile-jdk11
+++ b/Jenkinsfile-jdk11
@@ -116,7 +116,7 @@ pipeline {
 }
 steps {
 echo 'Deploying'
-sh 'mvn deploy'
+sh 'mvn deploy -DskipTests'
 }
 }
 }
@@ -178,4 +178,4 @@ Is back to normal.
 }
 }
 
-}
\ No newline at end of file
+}



[unomi] branch pr/223 deleted (was f81c809)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch pr/223
in repository https://gitbox.apache.org/repos/asf/unomi.git.


 was f81c809  Fix compilation error & other minor improvements

This change permanently discards the following revisions:

 discard f81c809  Fix compilation error & other minor improvements



[unomi] branch master updated (0d6417f -> dbfd3d9)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


from 0d6417f  Skip tests in jenkins deploy stage (#227)
 add dbfd3d9  UNOMI-409 add .gitignore to unomi-web-tracker (#228)

No new revisions were added by this update.

Summary of changes:
 extensions/web-tracker/javascript/.gitignore   | 1 +
 extensions/web-tracker/javascript/package.json | 7 ---
 extensions/web-tracker/javascript/{ => src}/snippet.js | 0
 3 files changed, 5 insertions(+), 3 deletions(-)
 create mode 100644 extensions/web-tracker/javascript/.gitignore
 rename extensions/web-tracker/javascript/{ => src}/snippet.js (100%)



[unomi] branch master updated: feat(updatePropertiesAction): support add values to a SET in a profile property (#230)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 9512fa7  feat(updatePropertiesAction): support add values to a SET in 
a profile property (#230)
9512fa7 is described below

commit 9512fa7991e2b889673fdc712301d2466d054ea3
Author: giladw 
AuthorDate: Wed Jan 6 09:55:42 2021 +0200

feat(updatePropertiesAction): support add values to a SET in a profile 
property (#230)
---
 .../unomi/plugins/baseplugin/actions/UpdatePropertiesAction.java| 6 ++
 1 file changed, 6 insertions(+)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdatePropertiesAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdatePropertiesAction.java
index 04d2e9b..ef175d9 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdatePropertiesAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdatePropertiesAction.java
@@ -37,6 +37,7 @@ public class UpdatePropertiesAction implements ActionExecutor 
{
 public static final String PROPS_TO_ADD = "add";
 public static final String PROPS_TO_UPDATE = "update";
 public static final String PROPS_TO_DELETE = "delete";
+public static final String PROPS_TO_ADD_TO_SET  = "addToSet";
 
 public static final String TARGET_ID_KEY = "targetId";
 public static final String TARGET_TYPE_KEY = "targetType";
@@ -76,6 +77,11 @@ public class UpdatePropertiesAction implements 
ActionExecutor {
 isProfileOrPersonaUpdated |= processProperties(target, 
propsToUpdate, "alwaysSet");
 }
 
+Map propsToAddToSet = (HashMap) 
event.getProperties().get(PROPS_TO_ADD_TO_SET);
+if (propsToAddToSet != null) {
+isProfileOrPersonaUpdated |= processProperties(target, 
propsToAddToSet, "addValues");
+}
+
 List propsToDelete = (List) 
event.getProperties().get(PROPS_TO_DELETE);
 if (propsToDelete != null) {
 for (String prop : propsToDelete) {



[unomi] branch master updated: UNOMI-410 : add patch template (#231)

2021-01-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 3f4bde8  UNOMI-410 : add patch template (#231)
3f4bde8 is described below

commit 3f4bde8821ef8bd62bc838b07123433e54a5aa5a
Author: jsinovassin <58434978+jsinovas...@users.noreply.github.com>
AuthorDate: Wed Jan 6 08:58:40 2021 +0100

UNOMI-410 : add patch template (#231)
---
 .../resources/META-INF/cxs/mappings/patch.json | 37 ++
 1 file changed, 37 insertions(+)

diff --git 
a/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/patch.json
 
b/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/patch.json
new file mode 100644
index 000..b18dfc2
--- /dev/null
+++ 
b/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/patch.json
@@ -0,0 +1,37 @@
+{
+  "dynamic_templates": [
+{
+  "all": {
+"match": "*",
+"match_mapping_type": "string",
+"mapping": {
+  "type": "text",
+  "analyzer": "folding",
+  "fields": {
+"keyword": {
+  "type": "keyword",
+  "ignore_above": 256
+}
+  }
+}
+  }
+}
+  ],
+  "properties": {
+"patchedItemId": {
+  "type": "text"
+},
+"patchedItemType": {
+  "type": "text"
+},
+"operation": {
+  "type": "text"
+},
+"data": {
+  "type": "object"
+},
+"lastApplication": {
+  "type": "date"
+}
+  }
+}



[unomi] branch master updated: UNOMI-412: change some DEBUG log to WARN, ERROR or INFO (#233)

2021-01-06 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 49acd46  UNOMI-412: change some DEBUG log to WARN, ERROR or INFO (#233)
49acd46 is described below

commit 49acd4646bfbb323631c285e3f46c635b80edd88
Author: kevan Jahanshahi 
AuthorDate: Wed Jan 6 11:01:37 2021 +0100

UNOMI-412: change some DEBUG log to WARN, ERROR or INFO (#233)

* UNOMI-412: change some DEBUG log to WARN, ERROR or INFO

* UNOMI-412: code review improvements
---
 .../unomi/router/core/processor/LineSplitFailureHandler.java   |  2 +-
 .../router/core/route/ProfileImportToUnomiRouteBuilder.java|  2 +-
 .../apache/unomi/sfdc/services/internal/SFDCServiceImpl.java   |  2 +-
 .../mailchimp/services/internal/MailChimpServiceImpl.java  |  4 ++--
 .../apache/unomi/graphql/commands/ProcessEventsCommand.java| 10 --
 .../elasticsearch/ElasticSearchPersistenceServiceImpl.java |  2 +-
 .../conditions/ConditionESQueryBuilderDispatcher.java  |  8 ++--
 .../plugins/baseplugin/actions/IncrementInterestAction.java|  2 +-
 .../GeoLocationByPointSessionConditionEvaluator.java   |  5 -
 .../unomi/plugins/request/actions/SetRemoteHostInfoAction.java | 10 --
 .../impl/cluster/ClusterSystemStatisticsEventHandler.java  |  2 +-
 .../services/impl/definitions/DefinitionsServiceImpl.java  |  2 +-
 .../apache/unomi/services/impl/events/EventServiceImpl.java|  2 +-
 wab/src/main/java/org/apache/unomi/web/ContextServlet.java |  4 +---
 14 files changed, 33 insertions(+), 24 deletions(-)

diff --git 
a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitFailureHandler.java
 
b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitFailureHandler.java
index 7543e48..a7aeb1a 100644
--- 
a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitFailureHandler.java
+++ 
b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitFailureHandler.java
@@ -32,7 +32,7 @@ public class LineSplitFailureHandler implements Processor {
 private static final Logger logger = 
LoggerFactory.getLogger(LineSplitFailureHandler.class.getName());
 
 public void process(Exchange exchange) throws Exception {
-logger.debug("Route: {}, Error: {}", 
exchange.getProperty(Exchange.FAILURE_ROUTE_ID), 
exchange.getProperty(Exchange.EXCEPTION_CAUGHT));
+logger.error("Route: {}, Error: {}", 
exchange.getProperty(Exchange.FAILURE_ROUTE_ID), 
exchange.getProperty(Exchange.EXCEPTION_CAUGHT));
 ImportLineError importLineError = new ImportLineError();
 if (exchange.getProperty(Exchange.EXCEPTION_CAUGHT) instanceof 
BadProfileDataFormatException) {
 importLineError.setErrorCode(((BadProfileDataFormatException) 
exchange.getProperty(Exchange.EXCEPTION_CAUGHT)).getCause().getMessage());
diff --git 
a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileImportToUnomiRouteBuilder.java
 
b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileImportToUnomiRouteBuilder.java
index 9c5a876..8336bf8 100644
--- 
a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileImportToUnomiRouteBuilder.java
+++ 
b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileImportToUnomiRouteBuilder.java
@@ -58,7 +58,7 @@ public class ProfileImportToUnomiRouteBuilder extends 
RouterAbstractRouteBuilder
 .unmarshal(jacksonDataFormat)
 .process(unomiStorageProcessor)
 .otherwise()
-.log(LoggingLevel.DEBUG, "Failed message, skip processing!")
+.log(LoggingLevel.WARN, "Failed message, skip processing!")
 .end()
 .aggregate(constant(true), new ArrayListAggregationStrategy())
 
.completionPredicate(exchangeProperty("CamelSplitComplete").isEqualTo("true"))
diff --git 
a/extensions/salesforce-connector/services/src/main/java/org/apache/unomi/sfdc/services/internal/SFDCServiceImpl.java
 
b/extensions/salesforce-connector/services/src/main/java/org/apache/unomi/sfdc/services/internal/SFDCServiceImpl.java
index 6f7a92a..fb5fbd8 100644
--- 
a/extensions/salesforce-connector/services/src/main/java/org/apache/unomi/sfdc/services/internal/SFDCServiceImpl.java
+++ 
b/extensions/salesforce-connector/services/src/main/java/org/apache/unomi/sfdc/services/internal/SFDCServiceImpl.java
@@ -370,7 +370,7 @@ public class SFDCServiceImpl implements SFDCService {
 sfdcLeadFields.put(consentSfdcId, consentValue);

[unomi] branch master updated: UNOMI-413-mergeProfileOnPropertyAction: support take Events profile as master, fix persistence bug when new profile is merged and it was the event profile (#232)

2021-01-06 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 1c9b970  UNOMI-413-mergeProfileOnPropertyAction: support take Events 
profile as master, fix persistence bug when new profile is merged and it was 
the event profile (#232)
1c9b970 is described below

commit 1c9b970d6d21ea3d2c6744292e748c32278b6876
Author: giladw 
AuthorDate: Wed Jan 6 17:20:34 2021 +0200

UNOMI-413-mergeProfileOnPropertyAction: support take Events profile as 
master, fix persistence bug when new profile is merged and it was the event 
profile (#232)
---
 .../actions/MergeProfilesOnPropertyAction.java | 22 ++
 .../cxs/actions/mergeProfilesOnPropertyAction.json |  5 +
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
index ffdf626..b01990b 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
@@ -132,11 +132,18 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 return StringUtils.isEmpty(mergeProfilePreviousPropertyValue) 
? EventService.PROFILE_UPDATED : EventService.NO_CHANGE;
 }
 
-// Use oldest profile for master profile
-final Profile masterProfile = 
profileService.mergeProfiles(profiles.get(0), profiles);
+Profile markedMasterProfile;
+boolean forceEventProfileAsMaster = 
action.getParameterValues().containsKey("forceEventProfileAsMaster") ?
+(boolean) 
action.getParameterValues().get("forceEventProfileAsMaster") : false;
+if (forceEventProfileAsMaster)
+markedMasterProfile = event.getProfile();
+else
+markedMasterProfile = profiles.get(0);// Use oldest profile 
for master profile
+
+final Profile masterProfile = 
profileService.mergeProfiles(markedMasterProfile, profiles);
 
 // Profile has changed
-if (!masterProfile.getItemId().equals(profileId)) {
+if (forceEventProfileAsMaster || 
!masterProfile.getItemId().equals(profileId)) {
 HttpServletResponse httpServletResponse = 
(HttpServletResponse) event.getAttributes().get(Event.HTTP_RESPONSE_ATTRIBUTE);
 // we still send back the current profile cookie. It will be 
changed on the next request to the ContextServlet.
 // The current profile will be deleted only then because we 
cannot delete it right now (too soon)
@@ -192,7 +199,14 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 sourceMap.put("mergedWith", 
masterProfileId);
 profile.setSystemProperty("lastUpdated", 
new Date());
 sourceMap.put("systemProperties", 
profile.getSystemProperties());
-persistenceService.update(profile, null, 
Profile.class, sourceMap);
+
+boolean isExist  = 
persistenceService.load(profile.getItemId(), Profile.class) != null;
+
+if (isExist == false) //save the original 
event profile is it has been changed
+persistenceService.save(profile);
+else
+  persistenceService.update(profile, null, 
Profile.class, sourceMap,true);
+
 }
 }
 } catch (Exception e) {
diff --git 
a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
index 6082f9f..07bf38c 100644
--- 
a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
+++ 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
@@ -15,6 +15,11 @@
   "id": "mergeProfilePropertyName",
   "type": "string",
   "multivalued": false
+},
+{
+  "id": "forceEventProfileAsMaster",
+  "type": "boolean",
+  "multivalued": false
 }
   ]
 }
\ No newline at end of file



[unomi] branch master updated: Fix IT compatibility with JDK 8

2021-01-06 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new c6efbf2  Fix IT compatibility with JDK 8
c6efbf2 is described below

commit c6efbf23e1e29b2fa03206abd498ce0ff8e2db8f
Author: Serge Huber 
AuthorDate: Wed Jan 6 17:18:06 2021 +0100

Fix IT compatibility with JDK 8
---
 .../java/org/apache/unomi/itests/IncrementInterestsIT.java   | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java 
b/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
index ba8ae25..85b63a0 100644
--- a/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/IncrementInterestsIT.java
@@ -16,11 +16,7 @@
  */
 package org.apache.unomi.itests;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.UUID;
+import java.util.*;
 
 import javax.inject.Inject;
 
@@ -45,8 +41,6 @@ import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerSuite;
 import org.ops4j.pax.exam.util.Filter;
 
-import com.sun.tools.javac.util.List;
-
 import static org.apache.unomi.itests.BasicIT.ITEM_TYPE_PAGE;
 
 @RunWith(PaxExam.class)
@@ -142,7 +136,9 @@ public class IncrementInterestsIT
 final Rule rule = new Rule();
 
 rule.setCondition( condition );
-rule.setActions( List.of( incrementAction ) );
+List actions = new ArrayList<>();
+actions.add(incrementAction);
+rule.setActions( actions );
 rule.setMetadata( metadata );
 
 rulesService.setRule( rule );



[unomi] branch unomi-404-and-375-fix-tests-with-default-eventtypes created (now 221aa1b)

2021-01-14 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch 
unomi-404-and-375-fix-tests-with-default-eventtypes
in repository https://gitbox.apache.org/repos/asf/unomi.git.


  at 221aa1b  UNOMI-404 & UNOMI 375 - Fix integration tests by adding 
default event types for all known Unomi event types - Implement more complete 
event validation for source and target not just properties -

This branch includes the following new commits:

 new 221aa1b  UNOMI-404 & UNOMI 375 - Fix integration tests by adding 
default event types for all known Unomi event types - Implement more complete 
event validation for source and target not just properties -

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[unomi] 01/01: UNOMI-404 & UNOMI 375 - Fix integration tests by adding default event types for all known Unomi event types - Implement more complete event validation for source and target not just pro

2021-01-14 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch 
unomi-404-and-375-fix-tests-with-default-eventtypes
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 221aa1b55f525b135cea19a68c6d6f00ca2d0847
Author: Serge Huber 
AuthorDate: Thu Jan 14 14:29:35 2021 +0100

UNOMI-404 & UNOMI 375
- Fix integration tests by adding default event types for all known Unomi 
event types
- Implement more complete event validation for source and target not just 
properties
-
---
 .../org/apache/unomi/itests/ContextServletIT.java  | 49 
 .../ElasticSearchPersistenceServiceImpl.java   |  4 +
 .../impl/events/EventTypeRegistryImpl.java | 87 +-
 .../META-INF/cxs/events/anonymizeProfile.json  | 23 ++
 .../META-INF/cxs/events/articleCompleted.json  | 69 +
 .../main/resources/META-INF/cxs/events/form.json   | 69 +
 .../main/resources/META-INF/cxs/events/goal.json   | 79 
 .../resources/META-INF/cxs/events/identify.json| 69 +
 .../META-INF/cxs/events/incrementInterest.json | 33 
 .../main/resources/META-INF/cxs/events/login.json  | 32 
 .../META-INF/cxs/events/modifyConsent.json | 77 +++
 .../META-INF/cxs/events/profileDeleted.json| 23 ++
 .../resources/META-INF/cxs/events/ruleFired.json   | 87 ++
 .../META-INF/cxs/events/sessionCreated.json| 52 +
 .../META-INF/cxs/events/sessionReassigned.json | 55 ++
 .../META-INF/cxs/events/updateProperties.json  | 26 +++
 .../main/resources/META-INF/cxs/events/view.json   | 69 +
 17 files changed, 855 insertions(+), 48 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java 
b/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
index 45cc2e0..ba9392b 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
@@ -137,11 +137,33 @@ public class ContextServletIT extends BaseIT {
 
 private void registerEventType(final String type) {
 final Set props = new HashSet<>();
-registerEventType(type, props);
+registerEventType(type, props, null, null);
 }
 
-private void registerEventType(final String type, final Set 
props) {
-final EventType eventType = new EventType(type, props, 1);
+private void registerEventType(final String type, final Set 
properties, final Set source, final Set target) {
+final Set typeProps = new HashSet<>();
+if (properties != null) {
+PropertyType propertiesPropType = new PropertyType();
+propertiesPropType.setItemId("properties");
+propertiesPropType.setValueTypeId("set");
+propertiesPropType.setChildPropertyTypes(properties);
+typeProps.add(propertiesPropType);
+}
+if (source != null) {
+PropertyType sourcePropType = new PropertyType();
+sourcePropType.setItemId("source");
+sourcePropType.setValueTypeId("set");
+sourcePropType.setChildPropertyTypes(source);
+typeProps.add(sourcePropType);
+}
+if (target != null) {
+PropertyType targetPropType = new PropertyType();
+targetPropType.setItemId("target");
+targetPropType.setValueTypeId("set");
+targetPropType.setChildPropertyTypes(target);
+typeProps.add(targetPropType);
+}
+final EventType eventType = new EventType(type, typeProps, 1);
 eventService.registerEventType(eventType);
 }
 
@@ -393,12 +415,12 @@ public class ContextServletIT extends BaseIT {
 contextRequest.setProfileId(profileId);
 contextRequest.setEvents(Arrays.asList(event));
 
-final Set typeProps = new HashSet<>();
+final Set propertiesPropTypes = new HashSet<>();
 PropertyType floatProp = new PropertyType();
 floatProp.setItemId("floatProperty");
 floatProp.setValueTypeId("float");
-typeProps.add(floatProp);
-this.registerEventType(eventType, typeProps);
+propertiesPropTypes.add(floatProp);
+this.registerEventType(eventType, propertiesPropTypes, null, null);
 
 //Act
 HttpPost request = new HttpPost(URL + CONTEXT_URL);
@@ -431,12 +453,12 @@ public class ContextServletIT extends BaseIT {
 contextRequest.setProfileId(profileId);
 contextRequest.setEvents(Arrays.asList(event));
 
-final Set typeProps = new HashSet<>();
+final Set propertiesPropTypes = new HashSet<>();
 PropertyType floatProp = new PropertyType();
   

[unomi] branch master updated: UNOMI-404 & UNOMI 375 (#236)

2021-01-18 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new dd983c8  UNOMI-404 & UNOMI 375 (#236)
dd983c8 is described below

commit dd983c8743c6e4453c96dbe5d9210ec63ea91cbb
Author: Serge Huber 
AuthorDate: Mon Jan 18 15:46:47 2021 +0100

UNOMI-404 & UNOMI 375 (#236)

- Fix integration tests by adding default event types for all known Unomi 
event types
- Implement more complete event validation for source and target not just 
properties
-
---
 .../org/apache/unomi/itests/ContextServletIT.java  | 49 
 .../ElasticSearchPersistenceServiceImpl.java   |  4 +
 .../impl/events/EventTypeRegistryImpl.java | 87 +-
 .../META-INF/cxs/events/anonymizeProfile.json  | 23 ++
 .../META-INF/cxs/events/articleCompleted.json  | 69 +
 .../main/resources/META-INF/cxs/events/form.json   | 69 +
 .../main/resources/META-INF/cxs/events/goal.json   | 79 
 .../resources/META-INF/cxs/events/identify.json| 69 +
 .../META-INF/cxs/events/incrementInterest.json | 33 
 .../main/resources/META-INF/cxs/events/login.json  | 32 
 .../META-INF/cxs/events/modifyConsent.json | 77 +++
 .../META-INF/cxs/events/profileDeleted.json| 23 ++
 .../resources/META-INF/cxs/events/ruleFired.json   | 87 ++
 .../META-INF/cxs/events/sessionCreated.json| 52 +
 .../META-INF/cxs/events/sessionReassigned.json | 55 ++
 .../META-INF/cxs/events/updateProperties.json  | 26 +++
 .../main/resources/META-INF/cxs/events/view.json   | 69 +
 17 files changed, 855 insertions(+), 48 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java 
b/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
index 45cc2e0..ba9392b 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
@@ -137,11 +137,33 @@ public class ContextServletIT extends BaseIT {
 
 private void registerEventType(final String type) {
 final Set props = new HashSet<>();
-registerEventType(type, props);
+registerEventType(type, props, null, null);
 }
 
-private void registerEventType(final String type, final Set 
props) {
-final EventType eventType = new EventType(type, props, 1);
+private void registerEventType(final String type, final Set 
properties, final Set source, final Set target) {
+final Set typeProps = new HashSet<>();
+if (properties != null) {
+PropertyType propertiesPropType = new PropertyType();
+propertiesPropType.setItemId("properties");
+propertiesPropType.setValueTypeId("set");
+propertiesPropType.setChildPropertyTypes(properties);
+typeProps.add(propertiesPropType);
+}
+if (source != null) {
+PropertyType sourcePropType = new PropertyType();
+sourcePropType.setItemId("source");
+sourcePropType.setValueTypeId("set");
+sourcePropType.setChildPropertyTypes(source);
+typeProps.add(sourcePropType);
+}
+if (target != null) {
+PropertyType targetPropType = new PropertyType();
+targetPropType.setItemId("target");
+targetPropType.setValueTypeId("set");
+targetPropType.setChildPropertyTypes(target);
+typeProps.add(targetPropType);
+}
+final EventType eventType = new EventType(type, typeProps, 1);
 eventService.registerEventType(eventType);
 }
 
@@ -393,12 +415,12 @@ public class ContextServletIT extends BaseIT {
 contextRequest.setProfileId(profileId);
 contextRequest.setEvents(Arrays.asList(event));
 
-final Set typeProps = new HashSet<>();
+final Set propertiesPropTypes = new HashSet<>();
 PropertyType floatProp = new PropertyType();
 floatProp.setItemId("floatProperty");
 floatProp.setValueTypeId("float");
-typeProps.add(floatProp);
-this.registerEventType(eventType, typeProps);
+propertiesPropTypes.add(floatProp);
+this.registerEventType(eventType, propertiesPropTypes, null, null);
 
 //Act
 HttpPost request = new HttpPost(URL + CONTEXT_URL);
@@ -431,12 +453,12 @@ public class ContextServletIT extends BaseIT {
 contextRequest.setProfileId(profileId);
 contextRequest.setEvents(Arrays.asList(event));
 
-final Set typeProps = new HashSet&l

[unomi] branch master updated: UNOMI-422 improve PropertiesUpdateActionIT (#241)

2021-02-03 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 40cac9b  UNOMI-422 improve PropertiesUpdateActionIT (#241)
40cac9b is described below

commit 40cac9bb99698fc35c2de5877e00c12c9671fe40
Author: MT BENTERKI 
AuthorDate: Wed Feb 3 10:40:04 2021 +0100

UNOMI-422 improve PropertiesUpdateActionIT (#241)
---
 .../unomi/itests/PropertiesUpdateActionIT.java | 132 +++--
 1 file changed, 124 insertions(+), 8 deletions(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java 
b/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java
index 1e64b91..f1b6304 100644
--- a/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java
@@ -35,9 +35,7 @@ import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
 import java.io.IOException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 /**
  * Created by amidani on 12/10/2017.
@@ -57,7 +55,7 @@ public class PropertiesUpdateActionIT extends BaseIT {
 protected EventService eventService;
 
 @Before
-public void setUp() throws IOException {
+public void setUp() throws IOException, InterruptedException {
 Profile profile = new Profile();
 profile.setItemId(PROFILE_TEST_ID);
 profileService.save(profile);
@@ -67,6 +65,8 @@ public class PropertiesUpdateActionIT extends BaseIT {
 profileTarget.setItemId(PROFILE_TARGET_TEST_ID);
 profileService.save(profileTarget);
 LOGGER.info("Profile saved with ID [{}].", profileTarget.getItemId());
+
+refreshPersistence();
 }
 
 @Test
@@ -81,16 +81,19 @@ public class PropertiesUpdateActionIT extends BaseIT {
 propertyToUpdate.put("properties.firstName", "UPDATED FIRST NAME 
CURRENT PROFILE");
 
 updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_UPDATE, 
propertyToUpdate);
+updateProperties.setProperty(UpdatePropertiesAction.TARGET_ID_KEY, 
PROFILE_TARGET_TEST_ID);
+updateProperties.setProperty(UpdatePropertiesAction.TARGET_TYPE_KEY, 
"profile");
+
 int changes = eventService.send(updateProperties);
 
 LOGGER.info("Changes of the event : {}", changes);
 
 Assert.assertTrue(changes > 0);
+Assert.assertEquals("UPDATED FIRST NAME CURRENT PROFILE", 
profile.getProperty("firstName"));
 }
 
 @Test
 public void testUpdateProperties_NotCurrentProfile() {
-
 Profile profile = profileService.load(PROFILE_TARGET_TEST_ID);
 Profile profileToUpdate = profileService.load(PROFILE_TEST_ID);
 Assert.assertNull(profileToUpdate.getProperty("firstName"));
@@ -104,12 +107,125 @@ public class PropertiesUpdateActionIT extends BaseIT {
 updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_UPDATE, 
propertyToUpdate);
 updateProperties.setProperty(UpdatePropertiesAction.TARGET_ID_KEY, 
PROFILE_TEST_ID);
 updateProperties.setProperty(UpdatePropertiesAction.TARGET_TYPE_KEY, 
"profile");
-int changes = eventService.send(updateProperties);
-
-LOGGER.info("Changes of the event : {}", changes);
+eventService.send(updateProperties);
 
 profileToUpdate = profileService.load(PROFILE_TEST_ID);
 Assert.assertEquals("UPDATED FIRST NAME", 
profileToUpdate.getProperty("firstName"));
+}
+
+@Test
+public void testUpdateProperties_CurrentProfile_PROPS_TO_ADD() throws 
InterruptedException {
+Profile profile = profileService.load(PROFILE_TEST_ID);
+
+Event updateProperties = new Event("updateProperties", null, profile, 
null, null, profile, new Date());
+updateProperties.setPersistent(false);
+
+Map propertyToAdd = new HashMap<>();
+propertyToAdd.put("properties.prop1", "New property 1");
+propertyToAdd.put("properties.prop2", "New property 2");
+propertyToAdd.put("properties.prop3", "New property 3");
+
+updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_ADD, 
propertyToAdd);
+updateProperties.setProperty(UpdatePropertiesAction.TARGET_ID_KEY, 
PROFILE_TEST_ID);
+updateProperties.setProperty(UpdatePropertiesAction.TARGET_TYPE_KEY, 
"profile");
+eventService.send(updateProperties);
+profileService.save(profile);
+refreshPersistence();
+
+profile = profileService.load(PROFILE_TEST_ID);
+Assert.assertEquals("New property 1", prof

[unomi] branch master updated: mergePropertyAction: when merge identifier change, if forceEventProfile, change identifier and do not create a new profile (#239)

2021-02-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 107011a  mergePropertyAction: when merge identifier change, if 
forceEventProfile, change identifier and do not create a new profile (#239)
107011a is described below

commit 107011a1d948db6ef8fc5b0217bd58afeb6a20b4
Author: giladw 
AuthorDate: Fri Feb 5 15:44:43 2021 +0200

mergePropertyAction: when merge identifier change, if forceEventProfile, 
change identifier and do not create a new profile (#239)
---
 .../baseplugin/actions/MergeProfilesOnPropertyAction.java   | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
index b01990b..93036d7 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
@@ -70,6 +70,9 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 
 final Session currentSession = event.getSession();
 
+boolean forceEventProfileAsMaster = 
action.getParameterValues().containsKey("forceEventProfileAsMaster") ?
+(boolean) 
action.getParameterValues().get("forceEventProfileAsMaster") : false;
+
 // store the profile id in case the merge change it to a previous one
 String profileId = profile.getItemId();
 
@@ -95,8 +98,12 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 profile = profiles.get(0);
 } else {
 // Create a new profile
-profile = new Profile(UUID.randomUUID().toString());
-profile.setProperty("firstVisit", event.getTimeStamp());
+if (forceEventProfileAsMaster)
+profile = event.getProfile();
+else {
+profile = new Profile(UUID.randomUUID().toString());
+profile.setProperty("firstVisit", event.getTimeStamp());
+}
 profile.getSystemProperties().put(mergeProfilePropertyName, 
mergeProfilePropertyValue);
 }
 
@@ -133,8 +140,6 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 }
 
 Profile markedMasterProfile;
-boolean forceEventProfileAsMaster = 
action.getParameterValues().containsKey("forceEventProfileAsMaster") ?
-(boolean) 
action.getParameterValues().get("forceEventProfileAsMaster") : false;
 if (forceEventProfileAsMaster)
 markedMasterProfile = event.getProfile();
 else



[unomi] branch master updated: UNOMI-424 Fix buildQuery for BooleanConditionESQueryBuilder (#243)

2021-02-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new ad67420  UNOMI-424 Fix buildQuery for BooleanConditionESQueryBuilder 
(#243)
ad67420 is described below

commit ad6742020714f2c3f63fe50cea41892caa8bb491
Author: MT BENTERKI 
AuthorDate: Fri Feb 5 14:48:25 2021 +0100

UNOMI-424 Fix buildQuery for BooleanConditionESQueryBuilder (#243)

add and fix IT
---
 .../apache/unomi/itests/ConditionEvaluatorIT.java  | 105 -
 .../conditions/BooleanConditionESQueryBuilder.java |   6 +-
 2 files changed, 59 insertions(+), 52 deletions(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/ConditionEvaluatorIT.java 
b/itests/src/test/java/org/apache/unomi/itests/ConditionEvaluatorIT.java
index 5a2421e..a1f93a6 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ConditionEvaluatorIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ConditionEvaluatorIT.java
@@ -43,7 +43,6 @@ import static org.junit.Assert.*;
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerSuite.class)
 public class ConditionEvaluatorIT extends BaseIT {
-
 protected ConditionBuilder builder;
 protected Item item;
 protected Date lastVisit;
@@ -61,8 +60,9 @@ public class ConditionEvaluatorIT extends BaseIT {
 public void setUp() {
 assertNotNull("Definition service should be available", 
definitionsService);
 assertNotNull("Persistence service should be available", 
persistenceService);
+builder = new ConditionBuilder(definitionsService);
 
-lastVisit = new GregorianCalendar(2015,1,1,20,30,0).getTime();
+lastVisit = new GregorianCalendar(2015, 
Calendar.FEBRUARY,1,20,30,0).getTime();
 
 Profile profile = new Profile("profile-" + 
UUID.randomUUID().toString());
 profile.setProperty("firstVisit", lastVisit);
@@ -70,37 +70,34 @@ public class ConditionEvaluatorIT extends BaseIT {
 profile.setProperty("gender", "female");
 profile.setProperty("lastVisit", lastVisit);
 profile.setProperty("randomStats", 0.15);
-profile.setSegments(new HashSet(Arrays.asList("s1", "s2", 
"s3")));
-this.item = profile;
-builder = new ConditionBuilder(definitionsService);
-
+profile.setSegments(new HashSet<>(Arrays.asList("s1", "s2", "s3")));
+item = profile;
 }
 
 @Test
 public void testCompound() {
 // test AND
 
assertTrue(eval(builder.and(builder.profileProperty("properties.gender").equalTo("female"),
-
builder.profileProperty("properties.age").equalTo(Integer.valueOf(30))).build()));
-
//assertFalse(eval(builder.and(builder.profileProperty("properties.gender").equalTo("male"),
-//
builder.profileProperty("properties.age").equalTo(Integer.valueOf(30))).build()));
-
//assertFalse(eval(builder.and(builder.profileProperty("properties.gender").equalTo("female"),
-//
builder.profileProperty("properties.age").equalTo(Integer.valueOf(40))).build()));
+
builder.profileProperty("properties.age").equalTo(30)).build()));
+
assertFalse(eval(builder.and(builder.profileProperty("properties.gender").equalTo("male"),
+
builder.profileProperty("properties.age").equalTo(30)).build()));
+
assertFalse(eval(builder.and(builder.profileProperty("properties.gender").equalTo("female"),
+
builder.profileProperty("properties.age").equalTo(40)).build()));
 
 // test OR
 
assertTrue(eval(builder.or(builder.profileProperty("properties.gender").equalTo("female"),
-
builder.profileProperty("properties.age").equalTo(Integer.valueOf(40))).build()));
+
builder.profileProperty("properties.age").equalTo(40)).build()));
 
assertTrue(eval(builder.or(builder.profileProperty("properties.gender").equalTo("male"),
-
builder.profileProperty("properties.age").equalTo(Integer.valueOf(30))).build()));
-
//assertFalse(eval(builder.or(builder.profileProperty("properties.gender").equalTo("male"),
-//
builder.profileProperty("properties.age").equalTo(Integer.valueOf(40))).build()));
+
builder.profileProperty("properties.age").equalTo(30)).build()));
+
assertFalse(eval(builder.or(builder.profileProperty("properties.gender").equalTo("male"),
+  

[unomi-site] branch master updated (994d6d8 -> 27b01da)

2021-02-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git.


from 994d6d8  Add docker image release instructions
 new 387beae  initial commit to add dropslolid reference
 new dbb4df8  formatting
 new 7202017  uppercase company name
 new d07b677  less marketing, more detail and info on contribution
 new e257fb7  Add quoted text to quote
 new 27b01da  Merge pull request #18 from woutersf/add-dropsolid-reference

The 87 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/webapp/stories.html | 17 +
 1 file changed, 17 insertions(+)



[unomi-site] branch master updated: Add instructions to serve with filtering to validate site before publishing.

2021-02-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new 6217bf2  Add instructions to serve with filtering to validate site 
before publishing.
6217bf2 is described below

commit 6217bf29b7a1af1b4b4f14f0150c7955eb5c3635
Author: Serge Huber 
AuthorDate: Fri Feb 5 15:44:31 2021 +0100

Add instructions to serve with filtering to validate site before publishing.
---
 README.md | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/README.md b/README.md
index b3d30cc..1774387 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,12 @@ mvn install scm-publish:publish-scm 
-Dusername=YOUR_APACHE_USERNAME -Dpassword=Y
 mvn install
 `
 
+## Jekyll serve (with filtering)
+
+`
+mvn gem:exec@jekyll-serve-filtered
+`
+
 ## Jekyll serve (from source)
 
 `



[unomi] branch master updated: UNOMI-425 Fix IT (#245)

2021-02-05 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 7178371  UNOMI-425 Fix IT (#245)
7178371 is described below

commit 71783712ca08d8a2a68236245dcddc7e6f7ca5e6
Author: MT BENTERKI 
AuthorDate: Fri Feb 5 17:10:00 2021 +0100

UNOMI-425 Fix IT (#245)

* UNOMI-425 Fix GraphQLProfilePropertiesIT

* UNOMI-425 remove system.out.println
---
 itests/src/test/java/org/apache/unomi/itests/BasicIT.java |  1 -
 .../unomi/itests/graphql/GraphQLProfilePropertiesIT.java  | 11 +--
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java 
b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
index da0e715..232ced3 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
@@ -116,7 +116,6 @@ public class BasicIT extends BaseIT {
 // by the connection manager.
 String responseContent;
 try (CloseableHttpResponse response = 
HttpClientBuilder.create().build().execute(request)) {
-System.out.println(response.getStatusLine());
 HttpEntity entity = response.getEntity();
 // do something useful with the response body
 // and ensure it is fully consumed
diff --git 
a/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLProfilePropertiesIT.java
 
b/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLProfilePropertiesIT.java
index 8cdd6ad..a10853e 100644
--- 
a/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLProfilePropertiesIT.java
+++ 
b/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLProfilePropertiesIT.java
@@ -21,11 +21,9 @@ import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.unomi.api.Consent;
 import org.apache.unomi.api.ConsentStatus;
 import org.apache.unomi.api.Profile;
-import org.apache.unomi.api.PropertyType;
 import org.apache.unomi.api.services.ProfileService;
 import org.apache.unomi.graphql.utils.DateUtils;
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 import org.ops4j.pax.exam.util.Filter;
 import org.slf4j.Logger;
@@ -47,13 +45,6 @@ public class GraphQLProfilePropertiesIT extends 
BaseGraphQLIT {
 
 private final static Logger LOGGER = 
LoggerFactory.getLogger(GraphQLProfilePropertiesIT.class);
 
-@Override
-@Before
-public void setUp() throws InterruptedException {
-super.setUp();
-recreateIndex(PropertyType.ITEM_TYPE);
-}
-
 @Test
 public void testCreateAndDeleteProfileProperty() throws Exception {
 try (CloseableHttpResponse response = 
post("graphql/profile/create-or-update-profile-properties.json")) {
@@ -125,7 +116,7 @@ public class GraphQLProfilePropertiesIT extends 
BaseGraphQLIT {
 try (CloseableHttpResponse response = 
post("graphql/profile/get-profile-fields.json")) {
 final ResponseContext context = 
ResponseContext.parse(response.getEntity());
 
-System.out.println(context.getResponseAsMap());
+LOGGER.info(StringUtils.join(context.getResponseAsMap()));
 
 // assert consent
 Assert.assertEquals("GRANTED", 
context.getValue("data.cdp.getProfile.cdp_consents[0].status"));



[unomi-site] branch master updated: Replace character with real dash

2021-02-08 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new 63cce8c  Replace character with real dash
 new a6da95c  Merge pull request #19 from woutersf/correct-dash
63cce8c is described below

commit 63cce8c1f401789a8303c4c46a69871e54abd751
Author: Fred Kroket 
AuthorDate: Fri Feb 5 20:02:45 2021 +0100

Replace character with real dash
---
 src/main/webapp/stories.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/webapp/stories.html b/src/main/webapp/stories.html
index b67e328..7a2184d 100644
--- a/src/main/webapp/stories.html
+++ b/src/main/webapp/stories.html
@@ -43,7 +43,7 @@ layout: default
 "Apache Unomi was chosen as our CDP due the logical and plugin 
architecture, because it is an Apache
 Open Source project and specially because of its Privacy (GPDR 
consent management) features.
 This lets the user own their data, but also marketers and 
developers improve the user journey to help
-the users in their decision process and brand experience" – 
Andy Kaiser, Ninetailed founder
+the users in their decision process and brand experience" - 
Andy Kaiser, Ninetailed founder
 https://ninetailed.io/"; target="_blank">ninetailed.io
 
 



[unomi-site] branch master updated: Add more complete commands to make sure we always clean first.

2021-02-08 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi-site.git


The following commit(s) were added to refs/heads/master by this push:
 new e1431ce  Add more complete commands to make sure we always clean first.
e1431ce is described below

commit e1431ce85c6c9d3f8574e9f008840794df16602b
Author: Serge Huber 
AuthorDate: Mon Feb 8 10:19:16 2021 +0100

Add more complete commands to make sure we always clean first.
---
 README.md | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 1774387..fbc095b 100644
--- a/README.md
+++ b/README.md
@@ -28,25 +28,25 @@ The generated site will be in target/generated-jekyll
 To publish the local website to the production location 
(https://unomi.apache.org/), you have to use:
 
 ```
-mvn install scm-publish:publish-scm -Dusername=YOUR_APACHE_USERNAME 
-Dpassword=YOUR_APACHE_PASSWORD
+mvn clean install scm-publish:publish-scm -Dusername=YOUR_APACHE_USERNAME 
-Dpassword=YOUR_APACHE_PASSWORD
 ```
 
 ## Generate jekyll site
 
 `
-mvn install
+mvn clean install install
 `
 
 ## Jekyll serve (with filtering)
 
 `
-mvn gem:exec@jekyll-serve-filtered
+mvn clean install gem:exec@jekyll-serve-filtered
 `
 
 ## Jekyll serve (from source)
 
 `
-mvn gem:exec@jekyll-serve-source
+mvn clean install gem:exec@jekyll-serve-source
 `
 
 Note: the Jekyll serve will not filter the files so you will still see 
property references such as ${latest.stable.version}.



[unomi] branch master updated: UNOMI-426 remove unneeded stages in Jenkinsfile-jdk11 (#248)

2021-02-08 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/master by this push:
 new 8b3c039  UNOMI-426 remove unneeded stages in Jenkinsfile-jdk11 (#248)
8b3c039 is described below

commit 8b3c03907db0f0997ee608a083338102f93b92e5
Author: MT BENTERKI 
AuthorDate: Mon Feb 8 16:27:55 2021 +0100

UNOMI-426 remove unneeded stages in Jenkinsfile-jdk11 (#248)
---
 Jenkinsfile   | 12 ++--
 Jenkinsfile-jdk11 | 30 +++---
 2 files changed, 9 insertions(+), 33 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index e777517..e3b1599 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -99,19 +99,19 @@ pipeline {
 stage('Generate doc') {
 when {
 expression {
-env.BRANCH_NAME ==~ /(1.4.x|1.5.x|master)/
+env.BRANCH_NAME ==~ /(unomi-1.4.x|unomi-1.5.x|master)/
 }
 }
 steps {
 echo 'Generate documentation'
-sh 'mvn javadoc:aggregate source:aggregate -Pdocs'
+sh 'mvn javadoc:aggregate source:aggregate'
 }
 }
 
 stage('Deploy') {
 when {
 expression {
-env.BRANCH_NAME ==~ /(1.4.x|1.5.x|master)/
+env.BRANCH_NAME ==~ /(unomi-1.4.x|unomi-1.5.x|master)/
 }
 }
 steps {
@@ -126,7 +126,7 @@ pipeline {
 // If this build failed, send an email to the list.
 failure {
 script {
-if(env.BRANCH_NAME == "1.4.x" || env.BRANCH_NAME == "1.5.x" || 
env.BRANCH_NAME == "master") {
+if(env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME == 
"unomi-1.5.x" || env.BRANCH_NAME == "master") {
 emailext(
 subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
 body: """
@@ -143,7 +143,7 @@ Check console output at "${env.JOB_NAME} [${env.BRANC
 // If this build didn't fail, but there were failing tests, send an 
email to the list.
 unstable {
 script {
-if(env.BRANCH_NAME == "1.4.x" || env.BRANCH_NAME == "1.5.x" || 
env.BRANCH_NAME == "master") {
+if(env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME == 
"unomi-1.5.x" || env.BRANCH_NAME == "master") {
 emailext(
 subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
 body: """
@@ -163,7 +163,7 @@ Check console output at "${env.JOB_NAME} [${env.BRANC
 // (in this cae we probably don't have to do any post-build 
analysis)
 deleteDir()
 script {
-if ((env.BRANCH_NAME == "1.4.x" || env.BRANCH_NAME == "1.5.x" 
|| env.BRANCH_NAME == "master") && (currentBuild.previousBuild != null) && 
(currentBuild.previousBuild.result != 'SUCCESS')) {
+if ((env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME == 
"unomi-1.5.x" || env.BRANCH_NAME == "master") && (currentBuild.previousBuild != 
null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
 emailext (
 subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
 body: """
diff --git a/Jenkinsfile-jdk11 b/Jenkinsfile-jdk11
index dd3f5d2..e9685ae 100644
--- a/Jenkinsfile-jdk11
+++ b/Jenkinsfile-jdk11
@@ -95,30 +95,6 @@ pipeline {
 sh 'mvn -pl itests clean install -Pintegration-tests'
 }
 }
-
-stage('Generate doc') {
-when {
-expression {
-env.BRANCH_NAME ==~ /(1.4.x|1.5.x|master)/
-}
-}
-steps {
-echo 'Generate documentation'
-sh 'mvn javadoc:aggregate source:aggregate -Pdocs'
-}
-}
-
-stage('Deploy') {
-when {
-expression {
-env.BRANCH_NAME ==~ /(1.4.x|1.5.x|master)/
-}
-}
-steps {
-echo 'Deploying'
-sh 'mvn deploy -DskipTests'
-}
- 

[unomi] 01/15: Fix bug in profile service it (#222)

2021-02-08 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit d4d6562b11630aa1f527f4d39bfd5c613f8a74ec
Author: liatiusim <62553663+liatiu...@users.noreply.github.com>
AuthorDate: Fri Dec 4 11:18:49 2020 +0100

Fix bug in profile service it (#222)

(cherry picked from commit cc1306f6b6475ce557bea40ac17f602c8b15587e)
---
 .../org/apache/unomi/itests/ProfileServiceIT.java  | 25 +++
 .../ElasticSearchPersistenceServiceImpl.java   | 21 
 .../unomi/persistence/spi/PersistenceService.java  | 28 ++
 3 files changed, 74 insertions(+)

diff --git a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java 
b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java
index db4e735..d75f608 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ProfileServiceIT.java
@@ -24,6 +24,8 @@ import org.apache.unomi.api.services.DefinitionsService;
 import org.apache.unomi.api.PartialList;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.Before;
@@ -112,4 +114,27 @@ public class ProfileServiceIT extends BaseIT {
 assertEquals(0, profiles.getList().size());
 }
 
+// Relevant only when throwExceptions system property is true
+@Test
+public void testGetProfileWithWrongScrollerIdThrowException() throws 
InterruptedException, NoSuchFieldException, IllegalAccessException {
+boolean throwExceptionCurrent = (boolean) 
persistenceService.getSetting("throwExceptions");
+persistenceService.setSetting("throwExceptions", true);
+
+Query query = new Query();
+query.setLimit(2);
+query.setScrollTimeValidity("10m");
+query.setScrollIdentifier("dummyScrollId");
+
+try {
+profileService.search(query, Profile.class);
+fail("search method didn't throw when expected");
+} catch (RuntimeException ex) {
+// Should get here since this scenario should throw exception
+}
+finally {
+persistenceService.setSetting("throwExceptions", 
throwExceptionCurrent);
+}
+}
+
+
 }
diff --git 
a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
 
b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
index f51a5c0..62aaa81 100644
--- 
a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
+++ 
b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
@@ -112,6 +112,7 @@ import javax.net.ssl.X509TrustManager;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.lang.reflect.Field;
 import java.net.URL;
 import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
@@ -694,6 +695,26 @@ public class ElasticSearchPersistenceServiceImpl 
implements PersistenceService,
 }
 
 @Override
+public void setSettings(Map settings) throws 
NoSuchFieldException, IllegalAccessException {
+for (Map.Entry setting : settings.entrySet())
+setSetting(setting.getKey(), setting.getValue());
+}
+
+@Override
+public void setSetting(String fieldName, Object value) throws 
NoSuchFieldException, IllegalAccessException {
+Field field = this.getClass().getDeclaredField(fieldName);
+field.set(getClass(), value);
+}
+
+@Override
+public Object getSetting(String fieldName) throws NoSuchFieldException, 
IllegalAccessException {
+Field field = this.getClass().getDeclaredField(fieldName);
+return field.get(getClass());
+}
+
+
+
+@Override
 public  T load(final String itemId, final Class clazz) {
 return load(itemId, null, clazz);
 }
diff --git 
a/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
 
b/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
index ce7d28e..d85059e 100644
--- 
a/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
+++ 
b/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PersistenceService.java
@@ -80,6 +80,34 @@ public interface PersistenceService {
  PartialList getAllItems(final Class clazz, int 
offset, int size, String sortBy, String scrollTimeValidity);
 
 /**
+ * Set settings of the persistence service
+ *
+  

[unomi] 09/15: UNOMI-413-mergeProfileOnPropertyAction: support take Events profile as master, fix persistence bug when new profile is merged and it was the event profile (#232)

2021-02-08 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 2f9ed6ed8d32c9888c0bf2670076d3e7fd639eed
Author: giladw 
AuthorDate: Wed Jan 6 17:20:34 2021 +0200

UNOMI-413-mergeProfileOnPropertyAction: support take Events profile as 
master, fix persistence bug when new profile is merged and it was the event 
profile (#232)

(cherry picked from commit 1c9b970d6d21ea3d2c6744292e748c32278b6876)
---
 .../actions/MergeProfilesOnPropertyAction.java | 22 ++
 .../cxs/actions/mergeProfilesOnPropertyAction.json |  5 +
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
index ffdf626..b01990b 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
@@ -132,11 +132,18 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 return StringUtils.isEmpty(mergeProfilePreviousPropertyValue) 
? EventService.PROFILE_UPDATED : EventService.NO_CHANGE;
 }
 
-// Use oldest profile for master profile
-final Profile masterProfile = 
profileService.mergeProfiles(profiles.get(0), profiles);
+Profile markedMasterProfile;
+boolean forceEventProfileAsMaster = 
action.getParameterValues().containsKey("forceEventProfileAsMaster") ?
+(boolean) 
action.getParameterValues().get("forceEventProfileAsMaster") : false;
+if (forceEventProfileAsMaster)
+markedMasterProfile = event.getProfile();
+else
+markedMasterProfile = profiles.get(0);// Use oldest profile 
for master profile
+
+final Profile masterProfile = 
profileService.mergeProfiles(markedMasterProfile, profiles);
 
 // Profile has changed
-if (!masterProfile.getItemId().equals(profileId)) {
+if (forceEventProfileAsMaster || 
!masterProfile.getItemId().equals(profileId)) {
 HttpServletResponse httpServletResponse = 
(HttpServletResponse) event.getAttributes().get(Event.HTTP_RESPONSE_ATTRIBUTE);
 // we still send back the current profile cookie. It will be 
changed on the next request to the ContextServlet.
 // The current profile will be deleted only then because we 
cannot delete it right now (too soon)
@@ -192,7 +199,14 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 sourceMap.put("mergedWith", 
masterProfileId);
 profile.setSystemProperty("lastUpdated", 
new Date());
 sourceMap.put("systemProperties", 
profile.getSystemProperties());
-persistenceService.update(profile, null, 
Profile.class, sourceMap);
+
+boolean isExist  = 
persistenceService.load(profile.getItemId(), Profile.class) != null;
+
+if (isExist == false) //save the original 
event profile is it has been changed
+persistenceService.save(profile);
+else
+  persistenceService.update(profile, null, 
Profile.class, sourceMap,true);
+
 }
 }
 } catch (Exception e) {
diff --git 
a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
index 6082f9f..07bf38c 100644
--- 
a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
+++ 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
@@ -15,6 +15,11 @@
   "id": "mergeProfilePropertyName",
   "type": "string",
   "multivalued": false
+},
+{
+  "id": "forceEventProfileAsMaster",
+  "type": "boolean",
+  "multivalued": false
 }
   ]
 }
\ No newline at end of file



[unomi] 14/15: UNOMI-425 Fix IT (#245)

2021-02-08 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 30e05c8d8ecae13ed407862a7aa13bec9b22aac2
Author: MT BENTERKI 
AuthorDate: Fri Feb 5 17:10:00 2021 +0100

UNOMI-425 Fix IT (#245)

* UNOMI-425 Fix GraphQLProfilePropertiesIT

* UNOMI-425 remove system.out.println

(cherry picked from commit 71783712ca08d8a2a68236245dcddc7e6f7ca5e6)
---
 itests/src/test/java/org/apache/unomi/itests/BasicIT.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java 
b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
index 0ae2feb..033b762 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
@@ -116,7 +116,6 @@ public class BasicIT extends BaseIT {
 // by the connection manager.
 String responseContent;
 try (CloseableHttpResponse response = 
HttpClientBuilder.create().build().execute(request)) {
-System.out.println(response.getStatusLine());
 HttpEntity entity = response.getEntity();
 // do something useful with the response body
 // and ensure it is fully consumed



[unomi] 12/15: mergePropertyAction: when merge identifier change, if forceEventProfile, change identifier and do not create a new profile (#239)

2021-02-08 Thread shuber
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch unomi-1.5.x
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 8b50dbf81144cec039a2dd807dc4800163a6225b
Author: giladw 
AuthorDate: Fri Feb 5 15:44:43 2021 +0200

mergePropertyAction: when merge identifier change, if forceEventProfile, 
change identifier and do not create a new profile (#239)

(cherry picked from commit 107011a1d948db6ef8fc5b0217bd58afeb6a20b4)
---
 .../baseplugin/actions/MergeProfilesOnPropertyAction.java   | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
index b01990b..93036d7 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/MergeProfilesOnPropertyAction.java
@@ -70,6 +70,9 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 
 final Session currentSession = event.getSession();
 
+boolean forceEventProfileAsMaster = 
action.getParameterValues().containsKey("forceEventProfileAsMaster") ?
+(boolean) 
action.getParameterValues().get("forceEventProfileAsMaster") : false;
+
 // store the profile id in case the merge change it to a previous one
 String profileId = profile.getItemId();
 
@@ -95,8 +98,12 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 profile = profiles.get(0);
 } else {
 // Create a new profile
-profile = new Profile(UUID.randomUUID().toString());
-profile.setProperty("firstVisit", event.getTimeStamp());
+if (forceEventProfileAsMaster)
+profile = event.getProfile();
+else {
+profile = new Profile(UUID.randomUUID().toString());
+profile.setProperty("firstVisit", event.getTimeStamp());
+}
 profile.getSystemProperties().put(mergeProfilePropertyName, 
mergeProfilePropertyValue);
 }
 
@@ -133,8 +140,6 @@ public class MergeProfilesOnPropertyAction implements 
ActionExecutor {
 }
 
 Profile markedMasterProfile;
-boolean forceEventProfileAsMaster = 
action.getParameterValues().containsKey("forceEventProfileAsMaster") ?
-(boolean) 
action.getParameterValues().get("forceEventProfileAsMaster") : false;
 if (forceEventProfileAsMaster)
 markedMasterProfile = event.getProfile();
 else



  1   2   3   4   5   6   7   8   9   10   >