incubator-unomi git commit: DMF-1556 : Csv without First name, and last name will show null, null in log file
Repository: incubator-unomi Updated Branches: refs/heads/feature-DMF-1343 f694dacb2 -> 1637a9122 DMF-1556 : Csv without First name, and last name will show null, null in log file Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/1637a912 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/1637a912 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/1637a912 Branch: refs/heads/feature-DMF-1343 Commit: 1637a9122fb106559751be881e54eb2a8fd83e5b Parents: f694dac Author: Abdelkader MidaniAuthored: Tue Jun 6 17:58:31 2017 +0200 Committer: Abdelkader Midani Committed: Tue Jun 6 17:58:31 2017 +0200 -- .../router/services/ProfileImportServiceImpl.java| 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/1637a912/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java -- diff --git a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java index 6dcc152..cb1d706 100644 --- a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java +++ b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java @@ -80,38 +80,37 @@ public class ProfileImportServiceImpl implements ProfileImportService, Synchrono public boolean saveMergeDeleteImportedProfile(ProfileToImport profileToImport) throws InvocationTargetException, IllegalAccessException { -logger.info("Importing profile: {}, {}", profileToImport.getProperties().get("firstName"), profileToImport.getProperties().get("lastName")); +logger.debug("Importing profile with ID : {}", profileToImport.getItemId()); Profile existingProfile = new Profile(); List existingProfiles = persistenceService.query("properties."+profileToImport.getMergingProperty(), (String)profileToImport.getProperties().get(profileToImport.getMergingProperty()), null, Profile.class); -logger.info("Query existing profile with mergingProperty: {}", profileToImport.getMergingProperty()); -logger.info("Found: {}", existingProfiles.size()); +logger.debug("Query existing profile with mergingProperty: {}. Found: {}", profileToImport.getMergingProperty(), existingProfiles.size()); //Profile already exist, and import config allow to overwrite profiles if(existingProfiles.size() == 1) { existingProfile = existingProfiles.get(0); if(profileToImport.isProfileToDelete()) { -logger.info("Profile is to delete!"); +logger.debug("Profile is to delete!"); persistenceService.remove(existingProfile.getItemId(), Profile.class); return true; } List propertiesToOverwrite = profileToImport.getPropertiesToOverwrite(); if(profileToImport.isOverwriteExistingProfiles() && propertiesToOverwrite!=null && propertiesToOverwrite.size() > 0) { // We overwrite only properties marked to overwrite -logger.info("Properties to overwrite: {}", propertiesToOverwrite); +logger.debug("Properties to overwrite: {}", propertiesToOverwrite); for(String propName : propertiesToOverwrite) { existingProfile.getProperties().put(propName, profileToImport.getProperties().get(propName)); } } else { //If no property is marked to overwrite we replace the whole properties map -logger.info("Overwrite all properties"); +logger.debug("Overwrite all properties"); existingProfile.setProperties(profileToImport.getProperties()); } } else if(existingProfiles.size() == 0) { -logger.info("New profile to add..."); +logger.debug("New profile to add..."); BeanUtils.copyProperties(existingProfile, profileToImport); } else { logger.warn("{} occurences found for profile with {} = {}. Profile import is skipped", existingProfiles.size(), profileToImport.getMergingProperty(), profileToImport.getProperties().get(profileToImport.getMergingProperty())); } -logger.info("-"); +logger.debug("-"); return
[09/17] incubator-unomi git commit: [jgitflow-maven-plugin]updating poms for dmf_1343 version
[jgitflow-maven-plugin]updating poms for dmf_1343 version Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/029720a4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/029720a4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/029720a4 Branch: refs/heads/feature-DMF-1343 Commit: 029720a4b8605cbd174fbec33f1a2eb5bb07c10a Parents: 46be002 Author: Abdelkader MidaniAuthored: Tue May 23 02:28:32 2017 +0200 Committer: Abdelkader Midani Committed: Tue Jun 6 17:35:46 2017 +0200 -- api/pom.xml | 2 +- extensions/geonames/pom.xml | 2 +- extensions/geonames/rest/pom.xml | 8 +++--- extensions/geonames/services/pom.xml | 8 +++--- extensions/lists-extension/actions/pom.xml| 8 +++--- extensions/lists-extension/pom.xml| 4 +-- extensions/lists-extension/rest/pom.xml | 8 +++--- extensions/lists-extension/services/pom.xml | 8 +++--- extensions/pom.xml| 2 +- extensions/privacy-extension/pom.xml | 4 +-- extensions/privacy-extension/rest/pom.xml | 8 +++--- extensions/privacy-extension/services/pom.xml | 8 +++--- kar/pom.xml | 32 +++--- lifecycle-watcher/pom.xml | 6 ++-- package/pom.xml | 4 +-- persistence-elasticsearch/core/pom.xml| 6 ++-- persistence-elasticsearch/pom.xml | 2 +- persistence-spi/pom.xml | 4 +-- plugins/baseplugin/pom.xml| 6 ++-- plugins/hover-event/pom.xml | 4 +-- plugins/mail/pom.xml | 4 +-- plugins/optimization-test/pom.xml | 2 +- plugins/past-event/pom.xml| 6 ++-- plugins/pom.xml | 4 +-- plugins/request/pom.xml | 2 +- plugins/tracked-event/pom.xml | 6 ++-- pom.xml | 2 +- rest/pom.xml | 6 ++-- samples/pom.xml | 2 +- samples/tweet-button-plugin/pom.xml | 4 +-- services/pom.xml | 6 ++-- wab/pom.xml | 6 ++-- 32 files changed, 91 insertions(+), 93 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/029720a4/api/pom.xml -- diff --git a/api/pom.xml b/api/pom.xml index 6662b6f..b69b98e 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -22,7 +22,7 @@ org.apache.unomi unomi-root -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT unomi-api http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/029720a4/extensions/geonames/pom.xml -- diff --git a/extensions/geonames/pom.xml b/extensions/geonames/pom.xml index f601a7c..7559e08 100644 --- a/extensions/geonames/pom.xml +++ b/extensions/geonames/pom.xml @@ -27,7 +27,7 @@ org.apache.unomi unomi-extensions -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT cxs-geonames http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/029720a4/extensions/geonames/rest/pom.xml -- diff --git a/extensions/geonames/rest/pom.xml b/extensions/geonames/rest/pom.xml index cec5546..9df2e43 100644 --- a/extensions/geonames/rest/pom.xml +++ b/extensions/geonames/rest/pom.xml @@ -20,7 +20,7 @@ org.apache.unomi cxs-geonames -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT 4.0.0 @@ -33,14 +33,14 @@ org.apache.unomi unomi-api -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT provided org.apache.unomi cxs-geonames-services -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT provided @@ -76,7 +76,7 @@ org.apache.unomi unomi-persistence-spi -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT provided http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/029720a4/extensions/geonames/services/pom.xml -- diff --git a/extensions/geonames/services/pom.xml
[12/17] incubator-unomi git commit: DMF-1343 : Move unomi-router under extensions
DMF-1343 : Move unomi-router under extensions Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/2f975d3c Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/2f975d3c Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/2f975d3c Branch: refs/heads/feature-DMF-1343 Commit: 2f975d3ce5014d007fcbdaebe09b54c507ce37c2 Parents: c95c6d3 Author: Abdelkader MidaniAuthored: Wed May 24 15:19:55 2017 +0200 Committer: Abdelkader Midani Committed: Tue Jun 6 17:35:46 2017 +0200 -- extensions/pom.xml | 1 + extensions/router/pom.xml | 64 +++ extensions/router/router-api/pom.xml| 43 + .../unomi/router/api/ImportConfiguration.java | 185 +++ .../unomi/router/api/ProfileToImport.java | 77 .../services/ImportConfigurationService.java| 60 ++ .../api/services/ProfileImportService.java | 29 +++ extensions/router/router-core/pom.xml | 182 ++ .../core/context/ProfileImportCamelContext.java | 165 + .../core/processor/ConfigUpdateProcessor.java | 44 + .../ImportConfigByFileNameProcessor.java| 44 + .../core/processor/LineSplitProcessor.java | 104 +++ .../core/processor/UnomiStorageProcessor.java | 46 + .../ProfileImportConfigUpdateRouteBuilder.java | 62 +++ .../ProfileImportKafkaToUnomiRouteBuilder.java | 77 .../route/ProfileImportOneShotRouteBuilder.java | 99 ++ .../ProfileImportSourceToKafkaRouteBuilder.java | 119 .../resources/OSGI-INF/blueprint/blueprint.xml | 94 ++ .../main/resources/org.apache.unomi.router.cfg | 23 +++ extensions/router/router-karaf-feature/pom.xml | 157 extensions/router/router-rest/pom.xml | 75 .../ImportConfigurationServiceEndPoint.java | 167 + .../resources/OSGI-INF/blueprint/blueprint.xml | 72 extensions/router/router-service/pom.xml| 104 +++ .../ImportConfigurationServiceImpl.java | 114 .../services/ProfileImportServiceImpl.java | 122 .../resources/OSGI-INF/blueprint/blueprint.xml | 39 pom.xml | 1 - router/pom.xml | 64 --- router/router-api/pom.xml | 43 - .../unomi/router/api/ImportConfiguration.java | 185 --- .../unomi/router/api/ProfileToImport.java | 77 .../services/ImportConfigurationService.java| 60 -- .../api/services/ProfileImportService.java | 29 --- router/router-core/pom.xml | 182 -- .../core/context/ProfileImportCamelContext.java | 165 - .../core/processor/ConfigUpdateProcessor.java | 44 - .../ImportConfigByFileNameProcessor.java| 44 - .../core/processor/LineSplitProcessor.java | 104 --- .../core/processor/UnomiStorageProcessor.java | 46 - .../ProfileImportConfigUpdateRouteBuilder.java | 62 --- .../ProfileImportKafkaToUnomiRouteBuilder.java | 77 .../route/ProfileImportOneShotRouteBuilder.java | 99 -- .../ProfileImportSourceToKafkaRouteBuilder.java | 119 .../resources/OSGI-INF/blueprint/blueprint.xml | 94 -- .../main/resources/org.apache.unomi.router.cfg | 23 --- router/router-karaf-feature/pom.xml | 157 router/router-rest/pom.xml | 75 .../ImportConfigurationServiceEndPoint.java | 167 - .../resources/OSGI-INF/blueprint/blueprint.xml | 72 router/router-service/pom.xml | 104 --- .../ImportConfigurationServiceImpl.java | 114 .../services/ProfileImportServiceImpl.java | 122 .../resources/OSGI-INF/blueprint/blueprint.xml | 39 54 files changed, 2368 insertions(+), 2368 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/2f975d3c/extensions/pom.xml -- diff --git a/extensions/pom.xml b/extensions/pom.xml index 6aa2fd8..8a874a6 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -34,6 +34,7 @@ lists-extension privacy-extension geonames +router http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/2f975d3c/extensions/router/pom.xml -- diff --git a/extensions/router/pom.xml b/extensions/router/pom.xml new file
[08/17] incubator-unomi git commit: DMF-1343 : Update POM versions
DMF-1343 : Update POM versions Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/59efa21f Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/59efa21f Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/59efa21f Branch: refs/heads/feature-DMF-1343 Commit: 59efa21fc9dd4f2a643dcd5ea52998daba98e19a Parents: b427f76 Author: Abdelkader MidaniAuthored: Fri Jun 2 16:39:32 2017 +0200 Committer: Abdelkader Midani Committed: Tue Jun 6 17:35:46 2017 +0200 -- extensions/router/router-core/pom.xml | 2 +- itests/pom.xml| 8 performance-tests/pom.xml | 4 ++-- persistence-elasticsearch/plugins/pom.xml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/59efa21f/extensions/router/router-core/pom.xml -- diff --git a/extensions/router/router-core/pom.xml b/extensions/router/router-core/pom.xml index b0b97c4..53780e7 100644 --- a/extensions/router/router-core/pom.xml +++ b/extensions/router/router-core/pom.xml @@ -56,7 +56,7 @@ org.apache.unomi unomi-router-api -1.2.0-incubating-SNAPSHOT +${project.version} org.apache.camel http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/59efa21f/itests/pom.xml -- diff --git a/itests/pom.xml b/itests/pom.xml index 6f3724c..55fe567 100644 --- a/itests/pom.xml +++ b/itests/pom.xml @@ -21,7 +21,7 @@ org.apache.unomi unomi-root -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT unomi-itests Apache Unomi :: Integration Tests @@ -32,19 +32,19 @@ org.apache.unomi unomi-kar features -1.2.0-incubating-SNAPSHOT +${project.version} xml org.apache.unomi unomi-persistence-spi -1.2.0-incubating-SNAPSHOT +${project.version} provided org.apache.unomi unomi-wab -1.2.0-incubating-SNAPSHOT +${project.version} test http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/59efa21f/performance-tests/pom.xml -- diff --git a/performance-tests/pom.xml b/performance-tests/pom.xml index 72c7abd..44117fc 100644 --- a/performance-tests/pom.xml +++ b/performance-tests/pom.xml @@ -20,7 +20,7 @@ org.apache.unomi unomi-root -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT unomi-performance-tests Apache Unomi :: Performance Tests @@ -30,7 +30,7 @@ org.apache.unomi unomi-wab -1.2.0-incubating-SNAPSHOT +${project.version} test http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/59efa21f/persistence-elasticsearch/plugins/pom.xml -- diff --git a/persistence-elasticsearch/plugins/pom.xml b/persistence-elasticsearch/plugins/pom.xml index 9114ece..57eec00 100644 --- a/persistence-elasticsearch/plugins/pom.xml +++ b/persistence-elasticsearch/plugins/pom.xml @@ -22,7 +22,7 @@ org.apache.unomi unomi-persistence-elasticsearch -1.2.0-incubating-SNAPSHOT +1.2.0-incubating-dmf_1343-SNAPSHOT unomi-persistence-elasticsearch-plugins
[15/17] incubator-unomi git commit: DMF-1343 : Improvement and documentation
DMF-1343 : Improvement and documentation Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/3c602041 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/3c602041 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/3c602041 Branch: refs/heads/feature-DMF-1343 Commit: 3c602041a7402dddb4ab119a7c62984149db65c1 Parents: 2f975d3 Author: Abdelkader MidaniAuthored: Wed May 24 17:26:14 2017 +0200 Committer: Abdelkader Midani Committed: Tue Jun 6 17:35:46 2017 +0200 -- extensions/router/README.md | 113 +++ .../ProfileImportConfigUpdateRouteBuilder.java | 2 +- .../resources/OSGI-INF/blueprint/blueprint.xml | 6 +- .../main/resources/org.apache.unomi.router.cfg | 4 +- .../ImportConfigurationServiceEndPoint.java | 37 +++--- .../resources/OSGI-INF/blueprint/blueprint.xml | 14 ++- 6 files changed, 154 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/3c602041/extensions/router/README.md -- diff --git a/extensions/router/README.md b/extensions/router/README.md new file mode 100644 index 000..8fa1994 --- /dev/null +++ b/extensions/router/README.md @@ -0,0 +1,113 @@ + + +Unomi Router +== + +## Getting started +Unomi Router Extension a Karaf Feature that provide an Enterprise Application Integration tool. +It is optional so you must configure it and install it in Karaf, and can be used for Machine - Machine or Human - Machine integration with Unomi. +Mainly Unomi Router Extension aim to make it easy to import third party applications/platforms profiles into Unomi. +This extension is implemented using Apache Camel routes and is using Apache Kafka to buffer import process and make it failsafe. + +## Getting started +1. Configure your Unomi Router: +In the `etc/org.apache.unomi.sfdc.cfg` file, you might want to update the following settings: +Kafka settings +>`#Kafka settings` + +>`kafka.host=localhost` + +>`kafka.port=9092` + +>`kafka.import.topic=camel-deposit` + +>`kafka.import.groupId=unomi-import-group` + +Kafka host and port with the topic name and the groupId ti which the topic is assigned + +>`#Import One Shot upload directory` + +>`import.oneshot.uploadDir=/tmp/unomi_oneshot_import_configs/` + +Path to the folder where unomi should stock file imported for a oneshot processing + + +2. Deploy into Apache Unomi using the following commands from the Apache Karaf shell: +```sh +$ feature:repo-add mvn:org.apache.unomi/unomi-router-karaf-feature/${version}/xml/features +$ feature:install unomi-router-karaf-feature +``` + +3. Send your import configuration: + +An import configuration is nothing else than a simple JSON to describe how you want to import your data (Profiles). +To create/update an import configuration + +`POST /cxs/importConfiguration` +```json + { + "itemId": "f57f1f86-97bf-4ba0-b4e4-7d5e77e7c0bd", + "itemType": "importConfig", + "scope": "integration", + "name": "Test Recurrent", + "description": "Just test recurrent import", + "configType": "recurrent", + "properties": { + "source": "{file/ftp}://{path}?fileName={file-name}.csv=.done=2", + "mapping": { + "firstName": 0, + "lastName": 1, + ... + } + }, + "mergingProperty": "email", + "overwriteExistingProfiles": true, + "propertiesToOverwrite": ["firstName", "lastName"], + "active": true + } +``` + +Omit the `itemId` when creating new entry, `configType` can be '**recurrent**' for file/ftp/network path polling or '**oneshot**' for one time import. + +The `properties.source` attribute is an Apache Camel endpoint uri (See http://camel.apache.org/uris.html for more details). Unomi Router is designed to use **File** and **FTP** Camel components. + +The attribute `properties.mapping` is a Map of: +* Key: Profile property id in Unomi +* Value: Index of the column in the imported file to copy the in the previous property. + +The attribute `mergingProperty` is the profile property id in Unomi to use to check for duplication. + +The attribute `propertiesToOverwrite` is a list of profile properties ids to overwrite, if **null** all properties +will be overwritten. + +The attribute `active` is the flag to activate or deactivate the import configuration. + +Concerning oneshot import configuration
[02/17] incubator-unomi git commit: UNOMI-72 Fix integration and performance tests - Integration tests should now execute again, but some tests still fail.
UNOMI-72 Fix integration and performance tests - Integration tests should now execute again, but some tests still fail. Signed-off-by: Serge HuberProject: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/53fb16ea Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/53fb16ea Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/53fb16ea Branch: refs/heads/feature-DMF-1343 Commit: 53fb16eadfe81d001007e0c306303e81f0648eed Parents: ef86038 Author: Serge Huber Authored: Mon May 29 14:10:22 2017 +0200 Committer: Serge Huber Committed: Mon May 29 14:10:22 2017 +0200 -- itests/pom.xml | 11 -- .../java/org/apache/unomi/itests/BaseIT.java| 4 ++- .../ElasticSearchPersistenceServiceImpl.java| 9 - .../resources/OSGI-INF/blueprint/blueprint.xml | 2 +- .../PropertyConditionESQueryBuilder.java| 35 ++-- pom.xml | 8 +++-- .../services/services/ClusterServiceImpl.java | 17 +- 7 files changed, 75 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53fb16ea/itests/pom.xml -- diff --git a/itests/pom.xml b/itests/pom.xml index 868fb1f..6f3724c 100644 --- a/itests/pom.xml +++ b/itests/pom.xml @@ -122,6 +122,12 @@ junit test + +org.slf4j +slf4j-simple +1.6.6 +test + @@ -147,8 +153,8 @@ 5.7 contextElasticSearch -9300 -9200 +9500 +9400 ${elasticsearch.version} @@ -175,6 +181,7 @@ org.apache.maven.plugins maven-failsafe-plugin +2.18.1 **/*AllITs.java http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53fb16ea/itests/src/test/java/org/apache/unomi/itests/BaseIT.java -- diff --git a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java index 6a10a4d..cfb8ed3 100644 --- a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java +++ b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java @@ -85,11 +85,13 @@ public abstract class BaseIT { .unpackDirectory(new File("target/exam")) .useDeployFolder(false), keepRuntimeFolder(), -configureConsole().ignoreLocalConsole().ignoreRemoteShell(), +configureConsole().ignoreLocalConsole(), logLevel(LogLevel.INFO), //editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", HTTP_PORT), // systemProperty("org.osgi.service.http.port").value(HTTP_PORT), systemProperty("org.ops4j.pax.exam.rbc.rmi.port").value("1199"), + systemProperty("org.apache.unomi.itests.elasticsearch.transport.port").value("9500"), + systemProperty("org.apache.unomi.itests.elasticsearch.http.port").value("9400"), features(karafPaxWebRepo, "war"), features(karafCxfRepo, "cxf"), features(karafCellarRepo, "cellar"), http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53fb16ea/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java -- 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 4e66418..bdd676d 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 @@ -143,7 +143,7 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService, private String bulkProcessorBackoffPolicy = "exponential"; private String minimalElasticSearchVersion = "5.0.0"; -private String maximalElasticSearchVersion = "5.2.0"; +private String
[04/17] incubator-unomi git commit: UNOMI-98 Provide an example of integrating with an externally triggered login Add missing license header
UNOMI-98 Provide an example of integrating with an externally triggered login Add missing license header Signed-off-by: Serge HuberProject: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/1a9f9cdc Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/1a9f9cdc Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/1a9f9cdc Branch: refs/heads/feature-DMF-1343 Commit: 1a9f9cdcb2203fd8c740a4700b9a9bbe92c144fd Parents: 21a9b34 Author: Serge Huber Authored: Mon May 29 16:05:42 2017 +0200 Committer: Serge Huber Committed: Mon May 29 16:05:42 2017 +0200 -- samples/README.md | 17 + 1 file changed, 17 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/1a9f9cdc/samples/README.md -- diff --git a/samples/README.md b/samples/README.md index 73811d2..6b60dfc 100644 --- a/samples/README.md +++ b/samples/README.md @@ -1 +1,18 @@ + + In this directory you can find different samples of how to integrate Unomi.
[01/17] incubator-unomi git commit: UNOMI-98 Provide an example of integrating with an externally triggered login - First commit of the login integration example [Forced Update!]
Repository: incubator-unomi Updated Branches: refs/heads/feature-DMF-1343 d95aa89ad -> f694dacb2 (forced update) UNOMI-98 Provide an example of integrating with an externally triggered login - First commit of the login integration example Signed-off-by: Serge HuberProject: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/ef860382 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/ef860382 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/ef860382 Branch: refs/heads/feature-DMF-1343 Commit: ef8603824a887c6ebeb8cf56d27f8cd7c6593cd1 Parents: 4f4ade0 Author: Serge Huber Authored: Mon May 29 13:57:03 2017 +0200 Committer: Serge Huber Committed: Mon May 29 13:57:03 2017 +0200 -- samples/login-integration/pom.xml | 64 + .../META-INF/cxs/rules/exampleLogin.json| 34 + .../src/main/webapp/WEB-INF/web.xml | 24 .../src/main/webapp/index.html | 70 ++ .../src/main/webapp/javascript/login-example.js | 136 +++ samples/pom.xml | 2 +- 6 files changed, 329 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/ef860382/samples/login-integration/pom.xml -- diff --git a/samples/login-integration/pom.xml b/samples/login-integration/pom.xml new file mode 100644 index 000..675807f --- /dev/null +++ b/samples/login-integration/pom.xml @@ -0,0 +1,64 @@ + + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> +4.0.0 + +samples +org.apache.unomi +1.2.0-incubating-SNAPSHOT + + +login-integration-sample +Apache Unomi :: Samples :: External Login plugin +bundle +This is a simple Apache Unomi plugin. + + + +org.apache.unomi +unomi-api +1.2.0-incubating-SNAPSHOT +provided + + +javax.servlet.jsp +jsp-api +2.1 +provided + + + + + + +org.apache.felix +maven-bundle-plugin +true + + +<_wab>src/main/webapp + *;scope=compile|runtime +WEB-INF/lib +/login + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/ef860382/samples/login-integration/src/main/resources/META-INF/cxs/rules/exampleLogin.json -- diff --git a/samples/login-integration/src/main/resources/META-INF/cxs/rules/exampleLogin.json b/samples/login-integration/src/main/resources/META-INF/cxs/rules/exampleLogin.json new file mode 100644 index 000..6e3604b --- /dev/null +++ b/samples/login-integration/src/main/resources/META-INF/cxs/rules/exampleLogin.json @@ -0,0 +1,34 @@ +{ + "metadata": { +"id": "exampleLogin", +"name": "Example Login", +"description": "Copy event properties to profile properties on login" + }, + "condition": { +"parameterValues": { + "subConditions": [ +{ + "parameterValues": { + }, + "type": "loginEventCondition" +} + ], + "operator": "and" +}, +"type": "booleanCondition" + }, + "actions": [ +{ + "parameterValues": { +"mergeProfilePropertyValue": "eventProperty::target.properties(email)", +"mergeProfilePropertyName": "mergeIdentifier" + }, + "type": "mergeProfilesOnPropertyAction" +}, +{ + "parameterValues": { + }, + "type": "allEventToProfilePropertiesAction" +} + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/ef860382/samples/login-integration/src/main/webapp/WEB-INF/web.xml -- diff --git a/samples/login-integration/src/main/webapp/WEB-INF/web.xml b/samples/login-integration/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000..dc145f2 --- /dev/null +++ b/samples/login-integration/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + +http://java.sun.com/xml/ns/javaee; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
[07/17] incubator-unomi git commit: DMF-1343 : Typo
DMF-1343 : Typo Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/b427f762 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/b427f762 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/b427f762 Branch: refs/heads/feature-DMF-1343 Commit: b427f762d6e10af37f2b6e46803216173273026e Parents: 8686a57 Author: Abdelkader MidaniAuthored: Mon May 29 16:58:12 2017 +0200 Committer: Abdelkader Midani Committed: Tue Jun 6 17:35:46 2017 +0200 -- extensions/router/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b427f762/extensions/router/README.md -- diff --git a/extensions/router/README.md b/extensions/router/README.md index 8fa1994..0d382d4 100644 --- a/extensions/router/README.md +++ b/extensions/router/README.md @@ -26,7 +26,7 @@ This extension is implemented using Apache Camel routes and is using Apache Kafk ## Getting started 1. Configure your Unomi Router: -In the `etc/org.apache.unomi.sfdc.cfg` file, you might want to update the following settings: +In the `etc/org.apache.unomi.router.cfg` file, you might want to update the following settings: Kafka settings >`#Kafka settings`
[16/17] incubator-unomi git commit: DMF-1566 : Flat files import - Ability to define column and line separator
DMF-1566 : Flat files import - Ability to define column and line separator Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/f694dacb Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/f694dacb Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/f694dacb Branch: refs/heads/feature-DMF-1343 Commit: f694dacb2f6da888ad818944a6385b84bc11dcbe Parents: 59efa21 Author: Abdelkader MidaniAuthored: Tue Jun 6 17:35:17 2017 +0200 Committer: Abdelkader Midani Committed: Tue Jun 6 17:35:46 2017 +0200 -- .../unomi/router/api/ImportConfiguration.java | 39 +++- .../core/processor/LineSplitProcessor.java | 12 +- .../route/ProfileImportOneShotRouteBuilder.java | 2 +- .../ProfileImportSourceToKafkaRouteBuilder.java | 3 +- .../resources/OSGI-INF/blueprint/blueprint.xml | 4 +- .../services/ProfileImportServiceImpl.java | 2 +- 6 files changed, 55 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/f694dacb/extensions/router/router-api/src/main/java/org/apache/unomi/router/api/ImportConfiguration.java -- diff --git a/extensions/router/router-api/src/main/java/org/apache/unomi/router/api/ImportConfiguration.java b/extensions/router/router-api/src/main/java/org/apache/unomi/router/api/ImportConfiguration.java index 770a7b5..29900f9 100644 --- a/extensions/router/router-api/src/main/java/org/apache/unomi/router/api/ImportConfiguration.java +++ b/extensions/router/router-api/src/main/java/org/apache/unomi/router/api/ImportConfiguration.java @@ -17,7 +17,6 @@ package org.apache.unomi.router.api; import org.apache.unomi.api.Item; -import org.apache.unomi.api.MetadataItem; import java.util.HashMap; import java.util.List; @@ -41,6 +40,9 @@ public class ImportConfiguration extends Item { private String mergingProperty; private boolean overwriteExistingProfiles = false; private List propertiesToOverwrite; + +private String columnSeparator = ","; +private String lineSeparator = "\n"; private boolean active = false; /** @@ -182,4 +184,39 @@ public class ImportConfiguration extends Item { this.propertiesToOverwrite = propertiesToOverwrite; } +/** + * gets the column separator. + */ +public String getColumnSeparator() { +return this.columnSeparator; +} + +/** + * Sets the column separator. + * @param columnSeparator property used to specify a line separator. Defaults to ',' + */ +public void setColumnSeparator(String columnSeparator) { +if(this.columnSeparator !=null) { +this.columnSeparator = columnSeparator; +} +} + +/** + * gets the line separator. + */ +public String getLineSeparator() { +return this.lineSeparator; +} + +/** + * Sets the line separator. + * @param lineSeparator property used to specify a line separator. Defaults to '\n' + */ +public void setLineSeparator(String lineSeparator) { +if(lineSeparator != null) { +this.lineSeparator = lineSeparator; +} +} + + } http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/f694dacb/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitProcessor.java -- diff --git a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitProcessor.java b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitProcessor.java index 30f79bf..150ef6d 100644 --- a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitProcessor.java +++ b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/processor/LineSplitProcessor.java @@ -37,6 +37,7 @@ public class LineSplitProcessor implements Processor { private List propertiesToOverwrite; private String mergingProperty; private boolean overwriteExistingProfiles; +private String columnSeparator; @Override public void process(Exchange exchange) throws Exception { @@ -47,8 +48,9 @@ public class LineSplitProcessor implements Processor { propertiesToOverwrite = importConfigOneShot.getPropertiesToOverwrite(); mergingProperty = importConfigOneShot.getMergingProperty(); overwriteExistingProfiles = importConfigOneShot.isOverwriteExistingProfiles(); +columnSeparator = importConfigOneShot.getColumnSeparator(); } -String[] profileData =
[13/17] incubator-unomi git commit: DMF-1343 Import profiles from CSV through API
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/90bf7f8e/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java -- diff --git a/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java b/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java new file mode 100644 index 000..e81930a --- /dev/null +++ b/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java @@ -0,0 +1,167 @@ +/* + * 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.router.rest; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.unomi.router.api.ImportConfiguration; +import org.apache.unomi.router.api.services.ImportConfigurationService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +/** + * A JAX-RS endpoint to manage {@link org.apache.unomi.router.api.ImportConfiguration}s. + */ +@WebService +@CrossOriginResourceSharing( +allowAllOrigins = true, +allowCredentials = true +) +public class ImportConfigurationServiceEndPoint { + +private static final Logger logger = LoggerFactory.getLogger(ImportConfigurationServiceEndPoint.class.getName()); + +private ImportConfigurationService importConfigurationService; +private String uploadDir; + +public ImportConfigurationServiceEndPoint () { +logger.info("Initializing import configuration service endpoint..."); +} + +@WebMethod(exclude = true) +public void setImportConfigurationService(ImportConfigurationService importConfigurationService) { +this.importConfigurationService = importConfigurationService; +} + +@WebMethod(exclude = true) +public void setUploadDir(String uploadDir) { +this.uploadDir = uploadDir; +} + +/** + * Retrieves all the import configurations. + * + * @return all the import configurations. + */ +@GET +@Path("/") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public List getImportConfigurations() { +return importConfigurationService.getImportConfigurations(); +} + +/** + * Retrieves an import configuration by id. + * + * @return the import configuration that matches the given id. + */ +@GET +@Path("/{configId}") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public ImportConfiguration getImportConfiguration(@PathParam("configId") String configId) { +return importConfigurationService.load(configId); +} + +/** + * Delete an import configuration by id. + * + * @return the deleted import configuration. + */ +@DELETE +@Path("/{configId}") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public void deleteImportConfiguration(@PathParam("configId") String configId) { +importConfigurationService.delete(configId); +} + + + +/** + * Save the given import configuration. + * + * @return the import configuration saved. + */ +@POST +@Path("/") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public ImportConfiguration saveImportConfiguration(ImportConfiguration importConfiguration) { +ImportConfiguration
[11/17] incubator-unomi git commit: DMF-1343 : Move unomi-router under extensions
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/2f975d3c/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java -- diff --git a/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java b/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java new file mode 100644 index 000..e81930a --- /dev/null +++ b/extensions/router/router-rest/src/main/java/org/apache/unomi/router/rest/ImportConfigurationServiceEndPoint.java @@ -0,0 +1,167 @@ +/* + * 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.router.rest; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.unomi.router.api.ImportConfiguration; +import org.apache.unomi.router.api.services.ImportConfigurationService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +/** + * A JAX-RS endpoint to manage {@link org.apache.unomi.router.api.ImportConfiguration}s. + */ +@WebService +@CrossOriginResourceSharing( +allowAllOrigins = true, +allowCredentials = true +) +public class ImportConfigurationServiceEndPoint { + +private static final Logger logger = LoggerFactory.getLogger(ImportConfigurationServiceEndPoint.class.getName()); + +private ImportConfigurationService importConfigurationService; +private String uploadDir; + +public ImportConfigurationServiceEndPoint () { +logger.info("Initializing import configuration service endpoint..."); +} + +@WebMethod(exclude = true) +public void setImportConfigurationService(ImportConfigurationService importConfigurationService) { +this.importConfigurationService = importConfigurationService; +} + +@WebMethod(exclude = true) +public void setUploadDir(String uploadDir) { +this.uploadDir = uploadDir; +} + +/** + * Retrieves all the import configurations. + * + * @return all the import configurations. + */ +@GET +@Path("/") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public List getImportConfigurations() { +return importConfigurationService.getImportConfigurations(); +} + +/** + * Retrieves an import configuration by id. + * + * @return the import configuration that matches the given id. + */ +@GET +@Path("/{configId}") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public ImportConfiguration getImportConfiguration(@PathParam("configId") String configId) { +return importConfigurationService.load(configId); +} + +/** + * Delete an import configuration by id. + * + * @return the deleted import configuration. + */ +@DELETE +@Path("/{configId}") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public void deleteImportConfiguration(@PathParam("configId") String configId) { +importConfigurationService.delete(configId); +} + + + +/** + * Save the given import configuration. + * + * @return the import configuration saved. + */ +@POST +@Path("/") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public ImportConfiguration saveImportConfiguration(ImportConfiguration importConfiguration)