[jira] [Commented] (UNOMI-97) Conditions Spanning Multiple Types
[ https://issues.apache.org/jira/browse/UNOMI-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16019308#comment-16019308 ] Serge Huber commented on UNOMI-97: -- Hello Damon, I believe your query works because all the properties you are matching exist in the event type but not in the profile type. Currently cross-type conditions only work in rules and segments, and I don't think the query service implements them yet. I think the query service could use some improvements. If you're interested in helping out, I would be very grateful because currently it is not something I have time to improve. Best regards, Serge... > Conditions Spanning Multiple Types > -- > > Key: UNOMI-97 > URL: https://issues.apache.org/jira/browse/UNOMI-97 > Project: Apache Unomi > Issue Type: Test > Components: core >Affects Versions: 1.2.0-incubating >Reporter: Damon Henry >Priority: Minor > Fix For: 1.2.0-incubating > > > I'm attempting to create boolean conditions that retrieve unique profile > counts but I may be interpreting the documentation incorrectly. A contrived > example is asking the context server to give me all profiles performing a > page view event. The example below provides the expected result when querying > the *event* type but return 0 when querying the *profile* type. > Is there a method to build segments using attributes from profiles, sessions, > and events? > http://localhost/cxs/query/event/count (return expected correct number of > events) > http://localhost/cxs/query/profile/count (returns zero; should this return > unique profiles) > {code} > { > "parameterValues": { > "operator": "and", > "subConditions": [ > { > "parameterValues": { > "propertyValue": "page", > "comparisonOperator": "equals", > "propertyName": "target.itemType" > }, > "type": "eventPropertyCondition" > }, > { > "parameterValues": { > "propertyValue": "view", > "comparisonOperator": "equals", > "propertyName": "eventType" > }, > "type": "eventPropertyCondition" > } > ] > }, > "type": "booleanCondition" > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[1/3] incubator-unomi git commit: [jgitflow-maven-plugin]updating poms for dmf_1343 version
Repository: incubator-unomi Updated Branches: refs/heads/feature-DMF-1343 [created] 5fa45c29b [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/9ac3a445 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/9ac3a445 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/9ac3a445 Branch: refs/heads/feature-DMF-1343 Commit: 9ac3a4452753069e3aac36a2935a2084ffe4f457 Parents: 4f4ade0 Author: Abdelkader Midani Authored: Tue May 23 02:28:32 2017 +0200 Committer: Abdelkader Midani Committed: Tue May 23 02:28:32 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/9ac3a445/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/9ac3a445/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/9ac3a445/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/9ac3a445/extensions/geonames/services/pom.xml -
[2/3] incubator-unomi git commit: DMF-1343 Import profiles from CSV through API
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/5fa45c29/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 importConfigS
[3/3] incubator-unomi git commit: DMF-1343 Import profiles from CSV through API
DMF-1343 Import profiles from CSV through API Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/5fa45c29 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/5fa45c29 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/5fa45c29 Branch: refs/heads/feature-DMF-1343 Commit: 5fa45c29be0f2d32cd29b4011330829e4abe3f7e Parents: 9ac3a44 Author: Abdelkader Midani Authored: Tue May 23 02:30:28 2017 +0200 Committer: Abdelkader Midani Committed: Tue May 23 02:30:28 2017 +0200 -- pom.xml | 1 + router/pom.xml | 64 +++ router/router-api/pom.xml | 43 + .../unomi/router/api/ImportConfiguration.java | 138 ++ .../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 | 67 +++ .../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 | 164 + 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 samples/trainingplugin.zip | Bin 0 -> 48508 bytes samples/trainingplugin/pom.xml | 55 ++ .../training/TrainedNotificationAction.java | 61 +++ .../cxs/actions/trainingNotifAction.json| 13 ++ .../META-INF/cxs/rules/trainedNotification.json | 20 ++ .../resources/OSGI-INF/blueprint/blueprint.xml | 34 33 files changed, 2516 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/5fa45c29/pom.xml -- diff --git a/pom.xml b/pom.xml index cc7d86d..0b87800 100644 --- a/pom.xml +++ b/pom.xml @@ -844,6 +844,7 @@ extensions kar samples +router package http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/5fa45c29/router/pom.xml -- diff --git a/router/pom.xml b/router/pom.xml new file mode 100644 index 000..73e9953 --- /dev/null +++ b/router/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 + + +unomi-root +org.apache.unomi +1.2.0-incubating-SNAPSHOT + + +unomi-router +Apache Unomi :: Extensions :: Router +Apache Camel Router for the Apache Unomi Context server +pom + + +2.18.3 + + + + + +org.apache.felix +maven-bundle-plugin +true + + + *;scope=compile|runtime + +sun.misc;resolution:=optional, +* + + + + + + + + +router-api +router-service +router-core +router-rest +router-karaf-feature + + + http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/5fa45c29/router/router-api/pom.xml -- diff --git a/router/router-api/pom.xml b/router/router-api/pom.xml new file mode 100644 index 000..9085a30 --- /dev/null +++ b/router/router-api/pom.xml @@ -0,0 +1,43 @@ + + +http://maven.apache.org/POM/4.0.0"; + xmlns:xsi="h