Repository: incubator-unomi Updated Branches: refs/heads/master f2117f691 -> a635d19cc
Documentation changes : - Add segments to extensions documentation. Signed-off-by: Serge Huber <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/a635d19c Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/a635d19c Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/a635d19c Branch: refs/heads/master Commit: a635d19cc18cf9f386bbf1986bebf3a0f42c7267 Parents: f2117f6 Author: Serge Huber <[email protected]> Authored: Fri Jul 21 17:21:58 2017 +0200 Committer: Serge Huber <[email protected]> Committed: Fri Jul 21 17:21:58 2017 +0200 ---------------------------------------------------------------------- .../versions/master/custom-extensions.md | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/a635d19c/src/site/markdown/versions/master/custom-extensions.md ---------------------------------------------------------------------- diff --git a/src/site/markdown/versions/master/custom-extensions.md b/src/site/markdown/versions/master/custom-extensions.md index 82acbf7..355896a 100644 --- a/src/site/markdown/versions/master/custom-extensions.md +++ b/src/site/markdown/versions/master/custom-extensions.md @@ -73,6 +73,39 @@ An extension is simply a Maven project, with a Maven pom that looks like this: An extension may contain many different kinds of Apache Unomi objects, as well as custom OSGi services or anything that is needed to build your application. +## Predefined segments + +You may provide pre-defined segments by simply adding a JSON file in the src/main/resources/META-INF/cxs/segments directory of +your Maven project. Here is an example of a pre-defined segment: + + { + "metadata": { + "id": "leads", + "name": "Leads", + "scope": "systemscope", + "description": "You can customize the list below by editing the leads segment.", + "readOnly":true + }, + "condition": { + "parameterValues": { + "subConditions": [ + { + "parameterValues": { + "propertyName": "properties.leadAssignedTo", + "comparisonOperator": "exists" + }, + "type": "profilePropertyCondition" + } + ], + "operator" : "and" + }, + "type": "booleanCondition" + } + } + +Basically this segment uses a condition to test if the profile has a property `leadAssignedTo` that exists. All profiles +that match this condition will be part of the pre-defined segment. + ## Predefined rules You may provide pre-defined rules by simply adding a JSON file in the src/main/resources/META-INF/cxs/rules directory of
