You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by ql...@apache.org on 2016/07/07 16:42:52 UTC

incubator-unomi git commit: UNOMI-38: Remove ChoiceListInitializers

Repository: incubator-unomi
Updated Branches:
  refs/heads/master f061241c5 -> 53ec1e9b9


UNOMI-38: Remove ChoiceListInitializers


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

Branch: refs/heads/master
Commit: 53ec1e9b96fd3a7d9113bb337ac47f5ec884f6bd
Parents: f061241
Author: Quentin Lamerand <ql...@jahia.com>
Authored: Thu Jul 7 18:42:45 2016 +0200
Committer: Quentin Lamerand <ql...@jahia.com>
Committed: Thu Jul 7 18:42:45 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/unomi/api/Parameter.java    |   6 +-
 .../initializers/ChoiceListInitializer.java     |  34 -----
 .../initializers/ChoiceListValue.java           |  60 ---------
 .../actions/eventToProfilePropertyAction.json   |   6 +-
 .../actions/mergeProfilesOnPropertyAction.json  |   3 +-
 .../cxs/conditions/eventPropertyCondition.json  |   6 +-
 .../cxs/conditions/eventTypeCondition.json      |   3 +-
 .../conditions/geoLocationSessionCondition.json |   3 +-
 .../cxs/conditions/goalMatchCondition.json      |   3 +-
 .../conditions/profilePropertyCondition.json    |   3 +-
 .../cxs/conditions/profileSegmentCondition.json |   3 +-
 .../conditions/sessionPropertyCondition.json    |   3 +-
 .../requestHeaderToProfilePropertyAction.json   |   1 -
 ...requestParameterToProfilePropertyAction.json |   1 -
 .../apache/unomi/rest/LocalizationHelper.java   |  27 +---
 .../org/apache/unomi/rest/RESTParameter.java    |  13 --
 .../CampaignsChoiceListInitializer.java         |  44 ------
 ...ComparisonOperatorChoiceListInitializer.java |  75 -----------
 .../ComparisonOperatorChoiceListValue.java      |  89 ------------
 .../CountryChoiceListInitializer.java           |  68 ----------
 .../EventPropertyChoiceListInitializer.java     |  47 -------
 .../EventTypeIdChoiceListInitializer.java       |  45 -------
 .../GoalsChoiceListInitializer.java             |  44 ------
 .../PropertyTypeChoiceListValue.java            | 135 -------------------
 .../SegmentsChoiceListInitializer.java          |  47 -------
 .../resources/OSGI-INF/blueprint/blueprint.xml  |  65 ---------
 26 files changed, 18 insertions(+), 816 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/api/src/main/java/org/apache/unomi/api/Parameter.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/unomi/api/Parameter.java b/api/src/main/java/org/apache/unomi/api/Parameter.java
index ac0ab74..c2b3b1e 100644
--- a/api/src/main/java/org/apache/unomi/api/Parameter.java
+++ b/api/src/main/java/org/apache/unomi/api/Parameter.java
@@ -29,7 +29,6 @@ public class Parameter {
     String id;
     String type;
     boolean multivalued = false;
-    String choiceListInitializerFilter;
     String defaultValue = null;
 
     public Parameter() {
@@ -47,8 +46,9 @@ public class Parameter {
         return multivalued;
     }
 
-    public String getChoiceListInitializerFilter() {
-        return choiceListInitializerFilter;
+    @Deprecated
+    public void setChoiceListInitializerFilter(String choiceListInitializerFilter) {
+        // Avoid errors when deploying old definitions
     }
 
     public String getDefaultValue() {

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListInitializer.java b/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListInitializer.java
deleted file mode 100644
index 485ac42..0000000
--- a/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListInitializer.java
+++ /dev/null
@@ -1,34 +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.api.conditions.initializers;
-
-import java.util.List;
-
-/**
- * An initializer for a list of options.
- */
-public interface ChoiceListInitializer {
-
-    /**
-     * Returns a list of options for this choice list.
-     *
-     * @param context a context object containing supporting information
-     * @return a list of options for this choice list
-     */
-    List<ChoiceListValue> getValues(Object context);
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListValue.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListValue.java b/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListValue.java
deleted file mode 100644
index 164a9ad..0000000
--- a/api/src/main/java/org/apache/unomi/api/conditions/initializers/ChoiceListValue.java
+++ /dev/null
@@ -1,60 +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.api.conditions.initializers;
-
-/**
- * List option object for various choice lists.
- */
-public class ChoiceListValue implements Cloneable {
-
-    private String id;
-
-    private String name;
-
-    public ChoiceListValue(String id, String name) {
-        this.id = id;
-        this.name = name;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Returns a cloned instance of this choice list value object with the name, set to the provided localized name.
-     * 
-     * @param localizedName
-     *            the localized name for this choice list value object
-     * @return a cloned instance of this choice list value object with the name, set to the provided localized name
-     */
-    public ChoiceListValue localizedCopy(String localizedName) {
-        try {
-            ChoiceListValue clone = (ChoiceListValue) clone();
-            clone.name = localizedName;
-
-            return clone;
-        } catch (CloneNotSupportedException e) {
-            throw new IllegalArgumentException(e);
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json
index 835f666..5539e1d 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/eventToProfilePropertyAction.json
@@ -13,14 +13,12 @@
     {
       "id": "eventPropertyName",
       "type": "string",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=eventProperty)"
+      "multivalued": false
     },
     {
       "id": "profilePropertyName",
       "type": "string",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=propertyType)"
+      "multivalued": false
     }
   ]
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/mergeProfilesOnPropertyAction.json
----------------------------------------------------------------------
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 18f90f4..62d3719 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
@@ -13,8 +13,7 @@
     {
       "id": "mergeProfilePropertyName",
       "type": "string",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=propertyType)"
+      "multivalued": false
     }
   ]
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json
index c2112d5..6c3ef41 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventPropertyCondition.json
@@ -16,14 +16,12 @@
     {
       "id": "propertyName",
       "type": "string",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=eventProperty)"
+      "multivalued": false
     },
     {
       "id": "comparisonOperator",
       "type": "comparisonOperator",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=comparisonOperator)"
+      "multivalued": false
     },
     {
       "id": "propertyValue",

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json
index cf1bcb6..0715f7a 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/eventTypeCondition.json
@@ -21,8 +21,7 @@
     {
       "id": "eventTypeId",
       "type": "String",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=eventTypeId)"
+      "multivalued": false
     }
   ]
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json
index 63187e0..4468079 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/geoLocationSessionCondition.json
@@ -52,8 +52,7 @@
   "parameters": [
     {
       "id": "country",
-      "type": "string",
-      "choiceListInitializerFilter": "(initializerId=country)"
+      "type": "string"
     },
     {
       "id": "admin1",

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json
index c7cf678..36a57ba 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/goalMatchCondition.json
@@ -21,8 +21,7 @@
     {
       "id": "goalId",
       "type": "string",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=goals)"
+      "multivalued": false
     }
   ]
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json
index 2d73d95..abaabd5 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profilePropertyCondition.json
@@ -21,8 +21,7 @@
     {
       "id": "comparisonOperator",
       "type": "comparisonOperator",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=comparisonOperator)"
+      "multivalued": false
     },
     {
       "id": "propertyValue",

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json
index 4b7b6ee..09b7e18 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/profileSegmentCondition.json
@@ -22,8 +22,7 @@
     {
       "id": "segments",
       "type": "string",
-      "multivalued": true,
-      "choiceListInitializerFilter": "(initializerId=segments)"
+      "multivalued": true
     },
     {
       "id": "matchType",

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json
----------------------------------------------------------------------
diff --git a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json
index 6e0cf07..c01dac5 100644
--- a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json
+++ b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/sessionPropertyCondition.json
@@ -20,8 +20,7 @@
     {
       "id": "comparisonOperator",
       "type": "comparisonOperator",
-      "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=comparisonOperator)"
+      "multivalued": false
     },
     {
       "id": "propertyValue",

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json
----------------------------------------------------------------------
diff --git a/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json b/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json
index adce6c9..a90df2c 100644
--- a/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json
+++ b/plugins/request/src/main/resources/META-INF/cxs/actions/requestHeaderToProfilePropertyAction.json
@@ -19,7 +19,6 @@
       "id": "profilePropertyName",
       "type": "string",
       "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=propertyType)"
     },
     {
       "id": "sessionPropertyName",

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json
----------------------------------------------------------------------
diff --git a/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json b/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json
index 740b041..12656da 100644
--- a/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json
+++ b/plugins/request/src/main/resources/META-INF/cxs/actions/requestParameterToProfilePropertyAction.json
@@ -19,7 +19,6 @@
       "id": "profilePropertyName",
       "type": "string",
       "multivalued": false,
-      "choiceListInitializerFilter": "(initializerId=propertyType)"
     },
     {
       "id": "sessionPropertyName",

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java
----------------------------------------------------------------------
diff --git a/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java b/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java
index 3052972..884ac8d 100644
--- a/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java
+++ b/rest/src/main/java/org/apache/unomi/rest/LocalizationHelper.java
@@ -22,15 +22,14 @@ import org.apache.unomi.api.Tag;
 import org.apache.unomi.api.ValueType;
 import org.apache.unomi.api.actions.ActionType;
 import org.apache.unomi.api.conditions.ConditionType;
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.ResourceBundle;
 
 /**
  * A helper class to provide localized versions of context server entities.
@@ -139,24 +138,6 @@ public class LocalizationHelper {
         result.setDefaultValue(parameter.getDefaultValue());
         result.setMultivalued(parameter.isMultivalued());
         result.setType(parameter.getType());
-        result.setChoiceListValues(generateChoiceListValues(parameter.getChoiceListInitializerFilter(), language));
-
-        return result;
-    }
-
-    public List<ChoiceListValue> generateChoiceListValues(String choiceListInitializerFilter, String language) {
-        List<ChoiceListValue> result = new ArrayList<ChoiceListValue>();
-        if (choiceListInitializerFilter != null && choiceListInitializerFilter.length() > 0) {
-            try {
-                Collection<ServiceReference<ChoiceListInitializer>> matchingChoiceListInitializerReferences = bundleContext.getServiceReferences(ChoiceListInitializer.class, choiceListInitializerFilter);
-                for (ServiceReference<ChoiceListInitializer> choiceListInitializerReference : matchingChoiceListInitializerReferences) {
-                    ChoiceListInitializer choiceListInitializer = bundleContext.getService(choiceListInitializerReference);
-                    result.addAll(choiceListInitializer.getValues(null));
-                }
-            } catch (InvalidSyntaxException e) {
-                logger.error("Invalid filter", e);
-            }
-        }
         return result;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/rest/src/main/java/org/apache/unomi/rest/RESTParameter.java
----------------------------------------------------------------------
diff --git a/rest/src/main/java/org/apache/unomi/rest/RESTParameter.java b/rest/src/main/java/org/apache/unomi/rest/RESTParameter.java
index 0cf9cde..87d79be 100644
--- a/rest/src/main/java/org/apache/unomi/rest/RESTParameter.java
+++ b/rest/src/main/java/org/apache/unomi/rest/RESTParameter.java
@@ -18,10 +18,6 @@
 package org.apache.unomi.rest;
 
 import org.apache.unomi.api.Parameter;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-
-import java.util.ArrayList;
-import java.util.List;
 
 /**
  * A representation of a {@link Parameter} better suited for definitions.
@@ -31,8 +27,6 @@ public class RESTParameter {
     private String type;
     private boolean multivalued = false;
     private String defaultValue = null;
-    private List<ChoiceListValue> choiceListValues = new ArrayList<ChoiceListValue>();
-
 
     public String getId() {
         return id;
@@ -66,11 +60,4 @@ public class RESTParameter {
         this.defaultValue = defaultValue;
     }
 
-    public List<ChoiceListValue> getChoiceListValues() {
-        return choiceListValues;
-    }
-
-    public void setChoiceListValues(List<ChoiceListValue> choiceListValues) {
-        this.choiceListValues = choiceListValues;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/CampaignsChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/CampaignsChoiceListInitializer.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/CampaignsChoiceListInitializer.java
deleted file mode 100644
index e9ec178..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/CampaignsChoiceListInitializer.java
+++ /dev/null
@@ -1,44 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.Metadata;
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-import org.apache.unomi.api.services.GoalsService;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class CampaignsChoiceListInitializer implements ChoiceListInitializer {
-
-    private GoalsService goalsService;
-
-    public void setGoalsService(GoalsService goalsService) {
-        this.goalsService = goalsService;
-    }
-
-    @Override
-    public List<ChoiceListValue> getValues(Object context) {
-        List<ChoiceListValue> r = new ArrayList<>();
-        for (Metadata metadata : goalsService.getCampaignMetadatas()) {
-            r.add(new ChoiceListValue(metadata.getId(), metadata.getName()));
-        }
-        return r;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListInitializer.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListInitializer.java
deleted file mode 100644
index 467ecf8..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListInitializer.java
+++ /dev/null
@@ -1,75 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-import org.osgi.framework.BundleContext;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Initializer for the set of available comparison operators.
- */
-public class ComparisonOperatorChoiceListInitializer implements ChoiceListInitializer {
-
-    private List<ChoiceListValue> operators;
-
-    private BundleContext bundleContext;
-
-    @Override
-    public List<ChoiceListValue> getValues(Object context) {
-        return operators;
-    }
-
-    public void setBundleContext(BundleContext bundleContext) {
-        this.bundleContext = bundleContext;
-
-        operators = new ArrayList<>(12);
-        operators.add(new ComparisonOperatorChoiceListValue("equals", "comparisonOperator.equals",
-                "string", "integer", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("notEquals", "comparisonOperator.notEquals",
-                "string", "integer", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("lessThan", "comparisonOperator.lessThan", "integer", "date"));
-        operators.add(new ComparisonOperatorChoiceListValue("greaterThan", "comparisonOperator.greaterThan", "integer", "date"));
-        operators.add(new ComparisonOperatorChoiceListValue("lessThanOrEqualTo", "comparisonOperator.lessThanOrEqualTo",
-                "integer", "date"));
-        operators.add(new ComparisonOperatorChoiceListValue("greaterThanOrEqualTo", "comparisonOperator.greaterThanOrEqualTo",
-                "integer", "date"));
-        operators.add(new ComparisonOperatorChoiceListValue("between", "comparisonOperator.between",
-                "integer", "date"));
-        operators.add(new ComparisonOperatorChoiceListValue("startsWith", "comparisonOperator.startsWith", "string", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("endsWith", "comparisonOperator.endsWith", "string", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("matchesRegex", "comparisonOperator.matchesRegularExpression",
-                "string", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("contains", "comparisonOperator.contains", "string", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("exists", "comparisonOperator.exists"));
-        operators.add(new ComparisonOperatorChoiceListValue("missing", "comparisonOperator.missing"));
-        operators.add(new ComparisonOperatorChoiceListValue("in", "comparisonOperator.in", "string", "integer", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("notIn", "comparisonOperator.notIn", "string", "integer", "email"));
-        operators.add(new ComparisonOperatorChoiceListValue("all", "comparisonOperator.all"));
-        operators.add(new ComparisonOperatorChoiceListValue("isDay", "comparisonOperator.isDay", "date"));
-        operators.add(new ComparisonOperatorChoiceListValue("isNotDay", "comparisonOperator.isNotDay", "date"));
-
-        for (ChoiceListValue op : operators) {
-            ((ComparisonOperatorChoiceListValue) op).setPluginId(bundleContext.getBundle().getBundleId());
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListValue.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListValue.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListValue.java
deleted file mode 100644
index d2fc050..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/ComparisonOperatorChoiceListValue.java
+++ /dev/null
@@ -1,89 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.PluginType;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Choice list value for the comparison operator, which also includes the information about applicable value types for the operator.
- * 
- * @author Sergiy Shyrkov
- */
-public class ComparisonOperatorChoiceListValue extends ChoiceListValue implements PluginType {
-
-    private Set<String> appliesTo = Collections.emptySet();
-
-    private long pluginId;
-
-    /**
-     * Initializes an instance of this class.
-     * 
-     * @param id
-     *            the ID of the property
-     * @param name
-     *            the display name
-     */
-    public ComparisonOperatorChoiceListValue(String id, String name) {
-        super(id, name);
-    }
-
-    /**
-     * Initializes an instance of this class.
-     * 
-     * @param id
-     *            the ID of the property
-     * @param name
-     *            the display name
-     * @param appliesTo
-     *            array of value types this operator applies to; if not specified the operator is applicable for all value types
-     */
-    public ComparisonOperatorChoiceListValue(String id, String name, String... appliesTo) {
-        this(id, name);
-        if (appliesTo != null && appliesTo.length > 0) {
-            this.appliesTo = new HashSet<>(appliesTo.length);
-            for (String at : appliesTo) {
-                this.appliesTo.add(at);
-            }
-        }
-    }
-
-    /**
-     * Returns a set of value types this comparison operator is applicable to. Returns an empty set in case there are no type restrictions,
-     * i.e. operator can be applied to any value type.
-     * 
-     * @return a set of value types this comparison operator is applicable to. Returns an empty set in case there are no type restrictions,
-     *         i.e. operator can be applied to any value type
-     */
-    public Set<String> getAppliesTo() {
-        return appliesTo;
-    }
-
-    @Override
-    public long getPluginId() {
-        return pluginId;
-    }
-
-    @Override
-    public void setPluginId(long pluginId) {
-        this.pluginId = pluginId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/CountryChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/CountryChoiceListInitializer.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/CountryChoiceListInitializer.java
deleted file mode 100644
index c63e406..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/CountryChoiceListInitializer.java
+++ /dev/null
@@ -1,68 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-
-import java.util.*;
-
-/**
- * Initializer for the set of known countries.
- * 
- * @author Sergiy Shyrkov
- */
-public class CountryChoiceListInitializer implements ChoiceListInitializer {
-
-    private static final Comparator<ChoiceListValue> NAME_COMPARATOR = new Comparator<ChoiceListValue>() {
-        @Override
-        public int compare(ChoiceListValue o1, ChoiceListValue o2) {
-            // we do not need to deal with null values, so make it straight
-            return o1.getName().compareTo(o2.getName());
-        }
-    };
-
-    private Map<String, Locale> countryLocales;
-
-    private Map<String, Locale> getContryLocales() {
-        if (countryLocales == null) {
-            Map<String, Locale> l = new HashMap<>();
-            String[] countryCodes = Locale.getISOCountries();
-            for (String code : countryCodes) {
-                l.put(code, new Locale("en", code));
-            }
-            countryLocales = l;
-        }
-
-        return countryLocales;
-    }
-
-    @Override
-    public List<ChoiceListValue> getValues(Object context) {
-        Locale locale = context instanceof Locale ? (Locale) context : Locale.ENGLISH;
-
-        Map<String, Locale> locales = getContryLocales();
-        List<ChoiceListValue> options = new ArrayList<ChoiceListValue>(locales.size());
-        for (Map.Entry<String, Locale> entry : locales.entrySet()) {
-            options.add(new ChoiceListValue(entry.getKey(), entry.getValue().getDisplayCountry(locale)));
-        }
-        Collections.sort(options, NAME_COMPARATOR);
-
-        return options;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventPropertyChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventPropertyChoiceListInitializer.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventPropertyChoiceListInitializer.java
deleted file mode 100644
index 0a8a04e..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventPropertyChoiceListInitializer.java
+++ /dev/null
@@ -1,47 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.EventProperty;
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-import org.apache.unomi.api.services.EventService;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Initializer for the set of available event properties.
- */
-public class EventPropertyChoiceListInitializer implements ChoiceListInitializer {
-
-    EventService eventService;
-
-    public List<ChoiceListValue> getValues(Object context) {
-        List<EventProperty> eventProperties = eventService.getEventProperties();
-        List<ChoiceListValue> choiceListValues = new ArrayList<>(eventProperties.size());
-        for (EventProperty eventProperty : eventProperties) {
-            choiceListValues.add(new PropertyTypeChoiceListValue(eventProperty.getId(), eventProperty.getId(), eventProperty.getValueType()));
-        }
-        return choiceListValues;
-    }
-
-    public void setEventService(EventService eventService) {
-        this.eventService = eventService;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventTypeIdChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventTypeIdChoiceListInitializer.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventTypeIdChoiceListInitializer.java
deleted file mode 100644
index 3076ff8..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/EventTypeIdChoiceListInitializer.java
+++ /dev/null
@@ -1,45 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-import org.apache.unomi.api.services.EventService;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-public class EventTypeIdChoiceListInitializer implements ChoiceListInitializer {
-
-    EventService eventService;
-
-    public void setEventService(EventService eventService) {
-        this.eventService = eventService;
-    }
-
-    public List<ChoiceListValue> getValues(Object context) {
-        List<ChoiceListValue> choiceListValues = new ArrayList<ChoiceListValue>();
-        Set<String> eventTypeIds = eventService.getEventTypeIds();
-        for (String eventProperty : eventTypeIds) {
-            String resourceKey = "eventType." + eventProperty;
-            choiceListValues.add(new ChoiceListValue(eventProperty, resourceKey));
-        }
-        return choiceListValues;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/GoalsChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/GoalsChoiceListInitializer.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/GoalsChoiceListInitializer.java
deleted file mode 100644
index 5f9a309..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/GoalsChoiceListInitializer.java
+++ /dev/null
@@ -1,44 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.Metadata;
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-import org.apache.unomi.api.services.GoalsService;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class GoalsChoiceListInitializer implements ChoiceListInitializer {
-
-    private GoalsService goalsService;
-
-    public void setGoalsService(GoalsService goalsService) {
-        this.goalsService = goalsService;
-    }
-
-    @Override
-    public List<ChoiceListValue> getValues(Object context) {
-        List<ChoiceListValue> r = new ArrayList<>();
-        for (Metadata metadata : goalsService.getGoalMetadatas()) {
-            r.add(new ChoiceListValue(metadata.getId(), metadata.getName()));
-        }
-        return r;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/PropertyTypeChoiceListValue.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/PropertyTypeChoiceListValue.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/PropertyTypeChoiceListValue.java
deleted file mode 100644
index 97809f5..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/PropertyTypeChoiceListValue.java
+++ /dev/null
@@ -1,135 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.PluginType;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-
-/**
- * Choice list value for the properties, which also includes the required value type of the property.
- * 
- * @author Sergiy Shyrkov
- */
-public class PropertyTypeChoiceListValue extends ChoiceListValue implements PluginType {
-
-    private boolean multivalued;
-
-    private String valueType = "string";
-
-    private long pluginId;
-
-    /**
-     * Initializes an instance of this class.
-     * 
-     * @param id
-     *            the ID of the property
-     * @param name
-     *            the display name
-     * @param valueType
-     *            the required property value type
-     */
-    public PropertyTypeChoiceListValue(String id, String name, String valueType) {
-        this(id, name, valueType, false);
-    }
-
-    /**
-     * Initializes an instance of this class.
-     * 
-     * @param id
-     *            the ID of the property
-     * @param name
-     *            the display name
-     * @param valueType
-     *            the required property value type
-     * @param multivalued
-     *            {@code true} if the property supports multiple values; {@code false} - in case it is a single value property
-     */
-    public PropertyTypeChoiceListValue(String id, String name, String valueType, boolean multivalued) {
-        super(id, name);
-        this.valueType = valueType;
-        this.multivalued = multivalued;
-    }
-
-    /**
-     * Initializes an instance of this class.
-     *
-     * @param id
-     *            the ID of the property
-     * @param name
-     *            the display name
-     * @param valueType
-     *            the required property value type
-     * @param multivalued
-     *            {@code true} if the property supports multiple values; {@code false} - in case it is a single value property
-     * @param pluginId
-     *            the PropertyType PluginId to retrieve bundle
-     */
-    public PropertyTypeChoiceListValue(String id, String name, String valueType, boolean multivalued, long pluginId) {
-        super(id, name);
-        this.multivalued = multivalued;
-        this.valueType = valueType;
-        this.pluginId = pluginId;
-    }
-
-    /**
-     * Returns the required property value type.
-     * 
-     * @return the required property value type
-     */
-    public String getValueType() {
-        return valueType;
-    }
-
-    /**
-     * Sets the required property value type.
-     *
-     * @param valueType
-     *            the required value type for this property
-     */
-    public void setValueType(String valueType) {
-        this.valueType = valueType;
-    }
-
-    /**
-     * Indicates if the property supports multiple values.
-     *
-     * @return {@code true} if the property supports multiple values; {@code false} - in case it is a single value property
-     */
-    public boolean isMultivalued() {
-        return multivalued;
-    }
-
-    /**
-     * Sets the indicator if the property supports multiple values.
-     *
-     * @param multivalued
-     *            {@code true} if the property supports multiple values; {@code false} - in case it is a single value property
-     */
-    public void setMultivalued(boolean multivalued) {
-        this.multivalued = multivalued;
-    }
-
-    @Override
-    public long getPluginId() {
-        return pluginId;
-    }
-
-    @Override
-    public void setPluginId(long pluginId) {
-        this.pluginId = pluginId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/java/org/apache/unomi/services/conditions/initializers/SegmentsChoiceListInitializer.java
----------------------------------------------------------------------
diff --git a/services/src/main/java/org/apache/unomi/services/conditions/initializers/SegmentsChoiceListInitializer.java b/services/src/main/java/org/apache/unomi/services/conditions/initializers/SegmentsChoiceListInitializer.java
deleted file mode 100644
index 4b3a9cb..0000000
--- a/services/src/main/java/org/apache/unomi/services/conditions/initializers/SegmentsChoiceListInitializer.java
+++ /dev/null
@@ -1,47 +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.services.conditions.initializers;
-
-import org.apache.unomi.api.Metadata;
-import org.apache.unomi.api.conditions.initializers.ChoiceListInitializer;
-import org.apache.unomi.api.conditions.initializers.ChoiceListValue;
-import org.apache.unomi.api.services.SegmentService;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Initializer for segment choice list.
- */
-public class SegmentsChoiceListInitializer implements ChoiceListInitializer {
-
-    SegmentService segmentService;
-
-    public void setSegmentService(SegmentService segmentService) {
-        this.segmentService = segmentService;
-    }
-
-    public List<ChoiceListValue> getValues(Object context) {
-        List<ChoiceListValue> choiceListValues = new ArrayList<ChoiceListValue>();
-        List<Metadata> profileProperties = segmentService.getSegmentMetadatas(0, 50, null).getList();
-        for (Metadata profileProperty : profileProperties) {
-            choiceListValues.add(new ChoiceListValue(profileProperty.getId(), profileProperty.getName()));
-        }
-        return choiceListValues;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/53ec1e9b/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git a/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index 11ec306..d1b9037 100644
--- a/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -127,71 +127,6 @@
     </bean>
     <service id="queryService" ref="queryServiceImpl" auto-export="interfaces"/>
 
-
-    <!-- Choice list initializers -->
-
-    <service auto-export="interfaces">
-        <service-properties>
-            <entry key="initializerId" value="comparisonOperator"/>
-        </service-properties>
-        <bean class="org.apache.unomi.services.conditions.initializers.ComparisonOperatorChoiceListInitializer">
-            <property name="bundleContext" ref="blueprintBundleContext"/>
-        </bean>
-    </service>
-
-    <service auto-export="interfaces">
-        <service-properties>
-            <entry key="initializerId" value="eventProperty"/>
-        </service-properties>
-        <bean class="org.apache.unomi.services.conditions.initializers.EventPropertyChoiceListInitializer">
-            <property name="eventService" ref="eventServiceImpl"/>
-        </bean>
-    </service>
-
-    <service auto-export="interfaces">
-        <service-properties>
-            <entry key="initializerId" value="segments"/>
-        </service-properties>
-        <bean class="org.apache.unomi.services.conditions.initializers.SegmentsChoiceListInitializer">
-            <property name="segmentService" ref="segmentServiceImpl"/>
-        </bean>
-    </service>
-
-    <service auto-export="interfaces">
-        <service-properties>
-            <entry key="initializerId" value="eventTypeId"/>
-        </service-properties>
-        <bean class="org.apache.unomi.services.conditions.initializers.EventTypeIdChoiceListInitializer">
-            <property name="eventService" ref="eventServiceImpl"/>
-        </bean>
-    </service>
-
-    <service auto-export="interfaces">
-        <service-properties>
-            <entry key="initializerId" value="country"/>
-        </service-properties>
-        <bean class="org.apache.unomi.services.conditions.initializers.CountryChoiceListInitializer"/>
-    </service>
-
-    <service auto-export="interfaces">
-        <service-properties>
-            <entry key="initializerId" value="goals"/>
-        </service-properties>
-        <bean class="org.apache.unomi.services.conditions.initializers.GoalsChoiceListInitializer">
-            <property name="goalsService" ref="goalsServiceImpl"/>
-        </bean>
-    </service>
-
-    <service auto-export="interfaces">
-        <service-properties>
-            <entry key="initializerId" value="campaigns"/>
-        </service-properties>
-        <bean class="org.apache.unomi.services.conditions.initializers.CampaignsChoiceListInitializer">
-            <property name="goalsService" ref="goalsServiceImpl"/>
-        </bean>
-    </service>
-
-
     <!-- We use a listener here because using the list directly for listening to proxies coming from the same bundle didn't seem to work -->
     <reference-list id="eventListenerServices"
                     interface="org.apache.unomi.api.services.EventListenerService"