You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by dr...@apache.org on 2016/04/27 17:31:01 UTC
incubator-unomi git commit: UNOMI-30 : Removed jahia specific
conditions/actions
Repository: incubator-unomi
Updated Branches:
refs/heads/master 6eb486ea8 -> 29e8747f1
UNOMI-30 : Removed jahia specific conditions/actions
Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/29e8747f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/29e8747f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/29e8747f
Branch: refs/heads/master
Commit: 29e8747f1852ca2492ea0e79bed323ef89ad6954
Parents: 6eb486e
Author: Thomas Draier <dr...@apache.org>
Authored: Wed Apr 27 17:30:53 2016 +0200
Committer: Thomas Draier <dr...@apache.org>
Committed: Wed Apr 27 17:30:53 2016 +0200
----------------------------------------------------------------------
.../actions/IncrementInterestsValuesAction.java | 63 --------------------
.../actions/incrementInterestValuesAction.json | 14 -----
.../cxs/conditions/downloadEventCondition.json | 43 -------------
.../cxs/conditions/loginEventCondition.json | 21 -------
.../cxs/conditions/pageViewEventCondition.json | 60 -------------------
.../conditions/profileInterestCondition.json | 33 ----------
.../META-INF/cxs/rules/advancedSearchForm.json | 34 -----------
.../META-INF/cxs/rules/incrementInterests.json | 39 ------------
.../resources/META-INF/cxs/rules/login.json | 37 ------------
.../META-INF/cxs/rules/searchForm.json | 37 ------------
.../META-INF/cxs/rules/sessionPageReferrer.json | 3 +-
.../META-INF/cxs/rules/sessionReferrer.json | 3 +-
.../resources/OSGI-INF/blueprint/blueprint.xml | 7 ---
13 files changed, 4 insertions(+), 390 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestsValuesAction.java
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestsValuesAction.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestsValuesAction.java
deleted file mode 100644
index b2c4484..0000000
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestsValuesAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.actions;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.unomi.api.Event;
-import org.apache.unomi.api.actions.Action;
-import org.apache.unomi.api.actions.ActionExecutor;
-import org.apache.unomi.api.services.EventService;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class IncrementInterestsValuesAction implements ActionExecutor {
-
- @SuppressWarnings("unchecked")
- @Override
- public int execute(Action action, Event event) {
- boolean modified = false;
-
- try {
- Map<String, Object> interests = (Map<String, Object>) PropertyUtils.getProperty(event, "target.properties.interests");
- if (interests != null) {
- for (Map.Entry<String, Object> s : interests.entrySet()) {
- int value = (Integer) s.getValue();
-
- HashMap<String, Object> profileInterests = (HashMap<String, Object>) event.getProfile().getProperty("interests");
- if(profileInterests != null){
- profileInterests = new HashMap<String, Object>(profileInterests);
- int oldValue = (profileInterests.containsKey(s.getKey())) ? (Integer) profileInterests.get(s.getKey()) : 0;
- profileInterests.put(s.getKey(), value + oldValue);
- }else {
- profileInterests = new HashMap<String, Object>();
- profileInterests.put(s.getKey(), value);
- }
- event.getProfile().setProperty("interests", profileInterests);
- modified = true;
- }
- }
- } catch (UnsupportedOperationException e) {
- throw e;
- } catch (Exception e) {
- throw new UnsupportedOperationException(e);
- }
-
- return modified ? EventService.PROFILE_UPDATED : EventService.NO_CHANGE;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterestValuesAction.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterestValuesAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterestValuesAction.json
deleted file mode 100644
index 824d667..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/incrementInterestValuesAction.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "metadata": {
- "id": "incrementInterestsValuesAction",
- "name": "incrementInterestsValuesAction",
- "description": "",
- "tags": [
- "event"
- ],
- "readOnly": true
- },
- "actionExecutor": "incrementInterestsValues",
- "parameters": [
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/downloadEventCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/downloadEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/downloadEventCondition.json
deleted file mode 100644
index 1b7adcf..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/downloadEventCondition.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "metadata": {
- "id": "downloadEventCondition",
- "name": "downloadEventCondition",
- "description": "",
- "tags": [
- "event",
- "eventCondition",
- "usableInPastEventCondition"
- ],
- "readOnly": true
- },
- "parentCondition": {
- "type": "booleanCondition",
- "parameterValues": {
- "subConditions": [
- {
- "type": "eventTypeCondition",
- "parameterValues": {
- "eventTypeId": "download"
- }
- },
- {
- "type": "eventPropertyCondition",
- "parameterValues": {
- "propertyName": "target.properties.path",
- "propertyValue": "parameter::filePath",
- "comparisonOperator": "equals"
- }
- }
- ],
- "operator": "and"
- }
- },
-
- "parameters": [
- {
- "id": "filePath",
- "type": "String",
- "multivalued": false
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/loginEventCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/loginEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/loginEventCondition.json
deleted file mode 100644
index 8cfb068..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/loginEventCondition.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "metadata": {
- "id": "loginEventCondition",
- "name": "loginEventCondition",
- "description": "",
- "tags": [
- "event",
- "eventCondition"
- ],
- "readOnly": true
- },
- "parentCondition": {
- "type": "eventTypeCondition",
- "parameterValues": {
- "eventTypeId": "login"
- }
- },
-
- "parameters": [
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pageViewEventCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pageViewEventCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pageViewEventCondition.json
deleted file mode 100644
index 3d003c5..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/pageViewEventCondition.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "metadata": {
- "id": "pageViewEventCondition",
- "name": "pageViewEventCondition",
- "description": "",
- "tags": [
- "event",
- "eventCondition",
- "usableInPastEventCondition"
- ],
- "readOnly": true
- },
- "parentCondition": {
- "type": "booleanCondition",
- "parameterValues": {
- "subConditions": [
- {
- "type": "eventTypeCondition",
- "parameterValues": {
- "eventTypeId": "view"
- }
- },
- {
- "type": "eventPropertyCondition",
- "parameterValues": {
- "propertyName": "target.properties.pageInfo.pagePath",
- "propertyValue": "parameter::pagePath",
- "comparisonOperator": "equals"
- }
- },
- {
- "type": "eventPropertyCondition",
- "parameterValues": {
- "propertyName": "target.properties.pageInfo.language",
- "propertyValue": "parameter::language",
- "comparisonOperator": "equals"
- }
- }
- ],
- "operator": "and"
- }
- },
- "parameters": [
- {
- "id": "url",
- "type": "string",
- "multivalued": false
- },
- {
- "id": "pagePath",
- "type": "string",
- "multivalued": false
- },
- {
- "id": "language",
- "type": "string",
- "multivalued": false
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileInterestCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileInterestCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileInterestCondition.json
deleted file mode 100644
index 088fe03..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileInterestCondition.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "metadata": {
- "id": "profileInterestCondition",
- "name": "profileInterestCondition",
- "description": "",
- "tags": [
- "demographic",
- "profileCondition"
- ],
- "readOnly": true
- },
- "parentCondition": {
- "type": "profilePropertyCondition",
- "parameterValues": {
- "propertyName": "script::'properties.interests.'+interestName.toLowerCase()",
- "propertyValueInteger": "parameter::value",
- "comparisonOperator": "greaterThan"
- }
- },
-
- "parameters": [
- {
- "id": "interestName",
- "type": "string",
- "multivalued": false
- },
- {
- "id": "value",
- "type": "integer",
- "multivalued": false
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/advancedSearchForm.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/advancedSearchForm.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/advancedSearchForm.json
deleted file mode 100644
index 6486375..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/advancedSearchForm.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "metadata": {
- "id": "advancedSearchForm",
- "name": "Advanced search form submit detection",
- "description": "Advanced search form submit detection",
- "readOnly": false
- },
- "condition": {
- "parameterValues": {
- "formId": "advancedSearchForm"
- },
- "type": "formEventCondition"
- },
- "actions": [
- {
- "type": "sendEventAction",
- "parameterValues": {
- "eventType": "search",
- "eventTarget": {
- "itemId": "advancedSearchForm",
- "itemType": "form",
- "scope": "eventProperty::target.scope",
- "properties": {}
- },
- "eventProperties": {
- "origin": "eventProperty::source.properties.pageInfo.pagePath",
- "language": "script::event.properties['src_languages.values'].toLowerCase()",
- "originForm": "eventProperty::target.itemId",
- "keyword": "script::event.properties['src_terms[0].term'].toLowerCase()"
- }
- }
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterests.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterests.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterests.json
deleted file mode 100644
index cd561f2..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/incrementInterests.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "metadata" : {
- "id": "_ynqbd6g4t_incrementInterests",
- "name": "Increment profile interests",
- "description" : "Evaluate segments when a profile is modified"
- },
-
- "raiseEventOnlyOnceForSession":true,
-
- "condition" : {
- "parameterValues": {
- "subConditions":[
- {
- "type": "pageViewEventCondition",
- "parameterValues": {
- }
- },
- {
- "type": "eventPropertyCondition",
- "parameterValues":{
- "propertyName":"target.properties.interests",
- "comparisonOperator":"exists"
- }
- }
- ],
- "operator" : "and"
- },
- "type": "booleanCondition"
- },
-
- "actions" : [
- {
- "type": "incrementInterestsValuesAction",
- "parameterValues": {
- }
- }
- ]
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/login.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/login.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/login.json
deleted file mode 100644
index de61572..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/login.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "metadata": {
- "id": "_sa0znsmk5_login",
- "name": "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(j:nodename)",
- "mergeProfilePropertyName": "mergeIdentifier"
- },
- "type": "mergeProfilesOnPropertyAction"
- },
- {
- "parameterValues": {
-
- },
- "type": "allEventToProfilePropertiesAction"
- }
- ]
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/searchForm.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/searchForm.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/searchForm.json
deleted file mode 100644
index b7f2e88..0000000
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/searchForm.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "metadata" : {
- "id": "_kw0g4zswm_searchForm",
- "name": "Search form submit detection",
- "description" : "Search form submit detection",
- "readOnly":false
- },
-
- "condition" : {
- "parameterValues": {
- "formId":"searchForm"
- },
- "type": "formEventCondition"
- },
-
- "actions" : [
- {
- "type": "sendEventAction",
- "parameterValues": {
- "eventType":"search",
- "eventTarget": {
- "itemId": "searchForm",
- "itemType" : "form",
- "scope":"eventProperty::target.scope",
- "properties" : {}
- },
- "eventProperties": {
- "origin": "eventProperty::source.properties.pageInfo.pagePath",
- "language": "eventProperty::source.properties.pageInfo.language",
- "originForm": "eventProperty::target.itemId",
- "keyword": "script::event.properties['src_terms[0].term'].toLowerCase()"
- }
- }
- }
- ]
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionPageReferrer.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionPageReferrer.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionPageReferrer.json
index b52c07a..ad09b7a 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionPageReferrer.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionPageReferrer.json
@@ -9,8 +9,9 @@
"priority": -9,
"condition": {
- "type": "pageViewEventCondition",
+ "type": "eventTypeCondition",
"parameterValues": {
+ "eventTypeId": "view"
}
},
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionReferrer.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionReferrer.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionReferrer.json
index 73f2155..9468f6d 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionReferrer.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/sessionReferrer.json
@@ -12,8 +12,9 @@
"parameterValues": {
"subConditions": [
{
- "type": "pageViewEventCondition",
+ "type": "eventTypeCondition",
"parameterValues": {
+ "eventTypeId": "view"
}
},
{
http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/29e8747f/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index 44e4c4e..125d52a 100644
--- a/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -184,13 +184,6 @@
<service auto-export="interfaces">
<service-properties>
- <entry key="actionExecutorId" value="incrementInterestsValues"/>
- </service-properties>
- <bean class="org.apache.unomi.plugins.baseplugin.actions.IncrementInterestsValuesAction"/>
- </service>
-
- <service auto-export="interfaces">
- <service-properties>
<entry key="actionExecutorId" value="setEventOccurenceCount"/>
</service-properties>
<bean class="org.apache.unomi.plugins.baseplugin.actions.SetEventOccurenceCountAction">