You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2018/09/10 09:30:18 UTC

[4/8] incubator-unomi git commit: Add archives versions of documentation in asciidoc

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc
----------------------------------------------------------------------
diff --git a/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc b/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc
new file mode 100644
index 0000000..23de08c
--- /dev/null
+++ b/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc
@@ -0,0 +1,433 @@
+//
+// Licensed 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.
+//
+
+=== Twitter sample
+
+==== Overview
+
+We will examine how a simple HTML page can interact with Unomi to enrich a user's profile. The use case we will follow
+is a rather simple one: we use a Twitter button to record the number of times the visitor tweeted (as a `tweetNb` profile
+integer property) as well as the URLs they tweeted from (as a `tweetedFrom` multi-valued string profile property).
+A javascript script will use the Twitter API to react to clicks on this button
+and update the user profile using a `ContextServlet` request triggering a custom event. This event will, in turn,
+trigger a Unomi action on the server implemented using a Unomi plugin, a standard extension point for the server.
+
+===== Building the tweet button sample
+
+In your local copy of the Unomi repository and run:
+
+[source]
+----
+cd samples/tweet-button-plugin
+mvn clean install
+----
+
+This will compile and create the OSGi bundle that can be deployed on Unomi to extend it.
+
+===== Deploying the tweet button sample
+
+In standard Karaf fashion, you will need to copy the sample bundle to your Karaf `deploy` directory.
+
+If you are using the packaged version of Unomi (as opposed to deploying it to your own Karaf version), you can simply run, assuming your current directory is `samples/tweet-button-plugin` and that you uncompressed the archive in the directory it was created:
+
+[source]
+----
+cp target/tweet-button-plugin-1.0.0-incubating-SNAPSHOT.jar ../../package/target/unomi-1.0.0-incubating-SNAPSHOT/deploy
+----
+
+===== Testing the sample
+
+You can now go to http://localhost:8181/index.html[http://localhost:8181/index.html] to test the sample code. The page is very simple, you will see a Twitter button, which, once clicked, will open a new window to tweet about the current page. The original page should be updated with the new values of the properties coming from Unomi. Additionnally, the raw JSON response is displayed.
+
+We will now explain in greater details some concepts and see how the example works.
+
+==== Interacting with the context server
+
+There are essentially two modalities to interact with the context server, reflecting different types of Unomi users: context server clients and context server integrators.
+
+*Context server clients* are usually web applications or content management systems. They interact with Unomi by providing raw, uninterpreted contextual data in the form of events and associated metadata. That contextual data is then processed by the context server to be fed to clients once actionable. In that sense context server clients are both consumers and producers of contextual data. Context server clients will mostly interact with Unomi using a single entry point called the `ContextServlet`, requesting context for the current user and providing any triggered events along the way.
+
+On the other hand, *context server integrators* provide ways to feed more structured data to the context server either to integrate with third party services or to provide analysis of the uninterpreted data provided by context server clients. Such integration will mostly be done using Unomi's API either directly using Unomi plugins or via the provided REST APIs. However, access to REST APIs is restricted due for security reasons, requiring privileged access to the Unomi server, making things a little more complex to set up.
+
+For simplicity's sake, this document will focus solely on the first use case and will interact only with the context servlet.
+
+==== Retrieving context information from Unomi using the context servlet
+
+Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `<context server base URL>/context.json` or `<context server base URL>/context.js` URLs, respectively.
+
+Below is an example of asynchronously loading the initial context using the javascript version, assuming a default Unomi install running on `http://localhost:8181`:
+
+[source,javascript]
+----
+// Load context from Unomi asynchronously
+(function (document, elementToCreate, id) {
+    var js, fjs = document.getElementsByTagName(elementToCreate)[0];
+    if (document.getElementById(id)) return;
+    js = document.createElement(elementToCreate);
+    js.id = id;
+    js.src = 'http://localhost:8181/context.js';
+    fjs.parentNode.insertBefore(js, fjs);
+}(document, 'script', 'context'));
+
+----
+
+This initial context results in a javascript file providing some functions to interact with the context server from javascript along with two objects: a `cxs` object containing
+information about the context for the current user and a `digitalData` object that is injected into the browser’s `window` object (leveraging the
+http://www.w3.org/2013/12/ceddl-201312.pdf[Customer Experience Digital Data Layer] standard). Note that this last object is not under control of the context server and clients
+ are free to use it or not. Our example will not make use of it.
+
+On the other hand, the `cxs` top level object contains interesting contextual information about the current user:
+
+[source,json]
+----
+{
+  "profileId":<identifier of the profile associated with the current user>,
+  "sessionId":<identifier of the current user session>,
+  "profileProperties":<requested profile properties, if any>,
+  "sessionProperties":<requested session properties, if any>,
+  "profileSegments":<segments the profile is part of if requested>,
+  "filteringResults":<result of the evaluation of personalization filters>,
+  "trackedConditions":<tracked conditions in the source page, if any>
+}
+----
+
+We will look at the details of the context request and response later.
+
+=== Example
+
+==== HTML page
+
+The code for the HTML page with our Tweet button can be found at https://github.com/apache/incubator-unomi/blob/master/wab/src/main/webapp/index.html[https://github.com/apache/incubator-unomi/blob/master/wab/src/main/webapp/index.html].
+
+This HTML page is fairly straightforward: we create a tweet button using the Twitter API while a Javascript script performs the actual logic.
+
+==== Javascript
+
+Globally, the script loads both the twitter widget and the initial context asynchronously (as shown previously). This is accomplished using fairly standard javascript code and we won't look at it here. Using the Twitter API, we react to the `tweet` event and call the Unomi server to update the user's profile with the required information, triggering a custom `tweetEvent` event. This is accomplished using a `contextRequest` function which is an extended version of a classic `AJAX` request:
+
+[source,javascript]
+----
+function contextRequest(successCallback, errorCallback, payload) {
+    var data = JSON.stringify(payload);
+    // if we don't already have a session id, generate one
+    var sessionId = cxs.sessionId || generateUUID();
+    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+    var xhr = new XMLHttpRequest();
+    var isGet = data.length < 100;
+    if (isGet) {
+        xhr.withCredentials = true;
+        xhr.open("GET", url + "&payload=" + encodeURIComponent(data), true);
+    } else if ("withCredentials" in xhr) {
+        xhr.open("POST", url, true);
+        xhr.withCredentials = true;
+    } else if (typeof XDomainRequest != "undefined") {
+        xhr = new XDomainRequest();
+        xhr.open("POST", url);
+    }
+    xhr.onreadystatechange = function () {
+        if (xhr.readyState != 4) {
+            return;
+        }
+        if (xhr.status == 200) {
+            var response = xhr.responseText ? JSON.parse(xhr.responseText) : undefined;
+            if (response) {
+                cxs.sessionId = response.sessionId;
+                successCallback(response);
+            }
+        } else {
+            console.log("contextserver: " + xhr.status + " ERROR: " + xhr.statusText);
+            if (errorCallback) {
+                errorCallback(xhr);
+            }
+        }
+    };
+    xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); // Use text/plain to avoid CORS preflight
+    if (isGet) {
+        xhr.send();
+    } else {
+        xhr.send(data);
+    }
+}
+----
+
+There are a couple of things to note here:
+
+* If we specify a payload, it is expected to use the JSON format so we `stringify` it and encode it if passed as a URL parameter in a `GET` request.
+* We need to make a https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS[`CORS`] request since the Unomi server is most likely not running on the same host than the one from which the request originates. The specific details are fairly standard and we will not explain them here.
+* We need to either retrieve (from the initial context we retrieved previously using `cxs.sessionId`) or generate a session identifier for our request since Unomi currently requires one.
+* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
+* We don't need to provide any authentication at all to interact with this part of Unomi since we only have access to read-only data (as well as providing events as we shall see later on). If we had been using the REST API, we would have needed to provide authentication information as well.
+
+===== Context request and response structure
+
+The interesting part, though, is the payload. This is where we provide Unomi with contextual information as well as ask for data in return. This allows clients to specify which type of information they are interested in getting from the context server as well as specify incoming events or content filtering or property/segment overrides for personalization or impersonation. This conditions what the context server will return with its response.
+
+Let's look at the context request structure:
+
+[source,json]
+----
+{
+    source: <Item source of the context request>,
+    events: <optional array of triggered events>,
+    requiredProfileProperties: <optional array of property identifiers>,
+    requiredSessionProperties: <optional array of property identifiers>,
+    filters: <optional array of filters to evaluate>,
+    profileOverrides: <optional profile containing segments,scores or profile properties to override>,
+            - segments: <optional array of segment identifiers>,
+            - profileProperties: <optional map of property name / value pairs>,
+            - scores: <optional map of score id / value pairs>
+    sessionPropertiesOverrides: <optional map of property name / value pairs>,
+    requireSegments: <boolean, whether to return the associated segments>
+}
+----
+
+We will now look at each part in greater details.
+
+====== Source
+
+A context request payload needs to at least specify some information about the source of the request in the form of an `Item` (meaning identifier, type and scope plus any additional properties we might have to provide), via the `source` property of the payload. Of course the more information can be provided about the source, the better.
+
+====== Filters
+
+A client wishing to perform content personalization might also specify filtering conditions to be evaluated by the context server so that it can tell the client whether the content associated with the filter should be activated for this profile/session. This is accomplished by providing a list of filter definitions to be evaluated by the context server via the `filters` field of the payload. If provided, the evaluation results will be provided in the `filteringResults` field of the resulting `cxs` object the context server will send.
+
+====== Overrides
+
+It is also possible for clients wishing to perform user impersonation to specify properties or segments to override the proper ones so as to emulate a specific profile, in which case the overridden value will temporarily replace the proper values so that all rules will be evaluated with these values instead of the proper ones. The `segments` (array of segment identifiers), `profileProperties` (maps of property name and associated object value) and `scores` (maps of score id and value) all wrapped in a profileOverrides object and the `sessionPropertiesOverrides` (maps of property name and associated object value) fields allow to provide such information. Providing such overrides will, of course, impact content filtering results and segments matching for this specific request.
+
+====== Controlling the content of the response
+
+The clients can also specify which information to include in the response by setting the `requireSegments` property to true if segments the current profile matches should be returned or provide an array of property identifiers for `requiredProfileProperties` or `requiredSessionProperties` fields to ask the context server to return the values for the specified profile or session properties, respectively. This information is provided by the `profileProperties`, `sessionProperties` and `profileSegments` fields of the context server response.
+
+Additionally, the context server will also returns any tracked conditions associated with the source of the context request. Upon evaluating the incoming request, the context server will determine if there are any rules marked with the `trackedCondition` tag and which source condition matches the source of the incoming request and return these tracked conditions to the client. The client can use these tracked conditions to learn that the context server can react to events matching the tracked condition and coming from that source. This is, in particular, used to implement form mapping (a solution that allows clients to update user profiles based on values provided when a form is submitted).
+
+====== Events
+
+Finally, the client can specify any events triggered by the user actions, so that the context server can process them, via the `events` field of the context request.
+
+====== Default response
+
+If no payload is specified, the context server will simply return the minimal information deemed necessary for client applications to properly function: profile identifier, session identifier and any tracked conditions that might exist for the source of the request.
+
+===== Context request for our example
+
+Now that we've seen the structure of the request and what we can expect from the context response, let's examine the request our component is doing.
+
+In our case, our `source` item looks as follows: we specify a scope for our application (`unomi-tweet-button-sample`), specify that the item type (i.e. the kind of element that is the source of our event) is a `page` (which corresponds, as would be expected, to a web page), provide an identifier (in our case, a Base-64 encoded version of the page's URL) and finally, specify extra properties (here, simply a `url` property corresponding to the page's URL that will be used when we process our event in our Unomi extension).
+
+[source,javascript]
+----
+var scope = 'unomi-tweet-button-sample';
+var itemId = btoa(window.location.href);
+var source = {
+    itemType: 'page',
+    scope: scope,
+    itemId: itemId,
+    properties: {
+        url: window.location.href
+    }
+};
+----
+
+We also specify that we want the context server to return the values of the `tweetNb` and `tweetedFrom` profile properties in its response. Finally, we provide a custom event of type `tweetEvent` with associated scope and source information, which matches the source of our context request in this case.
+
+[source,javascript]
+----
+var contextPayload = {
+    source: source,
+    events: [
+        {
+            eventType: 'tweetEvent',
+            scope: scope,
+            source: source
+        }
+    ],
+    requiredProfileProperties: [
+        'tweetNb',
+        'tweetedFrom'
+    ]
+};
+----
+
+The `tweetEvent` event type is not defined by default in Unomi. This is where our Unomi plugin comes into play since we need to tell Unomi how to react when it encounters such events.
+
+===== Unomi plugin overview
+
+In order to react to `tweetEvent` events, we will define a new Unomi rule since this is exactly what Unomi rules are supposed to do. Rules are guarded by conditions and if these
+ conditions match, the associated set of actions will be executed. In our case, we want our new
+ https://github.com/apache/incubator-unomi/blob/master/samples/tweet-button-plugin/src/main/resources/META-INF/cxs/rules/incrementTweetNumber.json[`incrementTweetNumber`] rule to only react to `tweetEvent` events and
+ we want it to perform the profile update accordingly: create the property types for our custom properties if they don't exist and update them. To do so, we will create a
+ custom
+ https://github.com/apache/incubator-unomi/blob/master/samples/tweet-button-plugin/src/main/resources/META-INF/cxs/actions/incrementTweetNumberAction.json[`incrementTweetNumberAction`] action that will be triggered any time our rule matches. An action is some custom code that is deployed in the context server and can access the
+ Unomi API to perform what it is that it needs to do.
+
+===== Rule definition
+
+Let's look at how our custom https://github.com/apache/incubator-unomi/blob/master/samples/tweet-button-plugin/src/main/resources/META-INF/cxs/rules/incrementTweetNumber.json[`incrementTweetNumber`] rule is defined:
+
+[source,json]
+----
+{
+  "metadata": {
+    "id": "smp:incrementTweetNumber",
+    "name": "Increment tweet number",
+    "description": "Increments the number of times a user has tweeted after they click on a tweet button"
+  },
+  "raiseEventOnlyOnceForSession": false,
+  "condition": {
+    "type": "eventTypeCondition",
+    "parameterValues": {
+      "eventTypeId": "tweetEvent"
+    }
+  },
+  "actions": [
+    {
+      "type": "incrementTweetNumberAction",
+      "parameterValues": {}
+    }
+  ]
+}
+----
+
+Rules define a metadata section where we specify the rule name, identifier and description.
+
+When rules trigger, a specific event is raised so that other parts of Unomi can react to it accordingly. We can control how that event should be raised. Here we specify that the event should be raised each time the rule triggers and not only once per session by setting `raiseEventOnlyOnceForSession` to `false`, which is not strictly required since that is the default. A similar setting (`raiseEventOnlyOnceForProfile`) can be used to specify that the event should only be raised once per profile if needed.
+
+We could also specify a priority for our rule in case it needs to be executed before other ones when similar conditions match. This is accomplished using the `priority` property. We're using the default priority here since we don't have other rules triggering on `tweetEvent`s and don't need any special ordering.
+
+We then tell Unomi which condition should trigger the rule via the `condition` property. Here, we specify that we want our rule to trigger on an `eventTypeCondition` condition. Unomi can be extended by adding new condition types that can enrich how matching or querying is performed. The condition type definition file specifies which parameters are expected for our condition to be complete. In our case, we use the built-in event type condition that will match if Unomi receives an event of the type specified in the condition's `eventTypeId` parameter value: `tweetEvent` here.
+
+Finally, we specify a list of actions that should be performed as consequences of the rule matching. We only need one action of type `incrementTweetNumberAction` that doesn't require any parameters.
+
+===== Action definition
+
+Let's now look at our custom https://github.com/apache/incubator-unomi/blob/master/samples/tweet-button-plugin/src/main/resources/META-INF/cxs/actions/incrementTweetNumberAction.json[`incrementTweetNumberAction`] action type definition:
+
+[source,json]
+----
+{
+  "id": "incrementTweetNumberAction",
+  "actionExecutor": "incrementTweetNumber",
+  "tags": [
+    "event"
+  ],
+  "parameters": []
+}
+----
+
+We specify the identifier for the action type, a list of tags if needed: here we say that our action is a consequence of events using the `event` tag. Our actions does not require any parameters so we don't define any.
+
+Finally, we provide a mysterious `actionExecutor` identifier: `incrementTweetNumber`.
+
+===== Action executor definition
+
+The action executor references the actual implementation of the action as defined in our https://github.com/apache/incubator-unomi/blob/master/samples/tweet-button-plugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml[blueprint definition]:
+
+[source,xml]
+----
+<blueprint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+    <reference id="profileService" interface="org.apache.unomi.api.services.ProfileService"/>
+
+    <!-- Action executor -->
+    <service id="incrementTweetNumberAction" auto-export="interfaces">
+        <service-properties>
+            <entry key="actionExecutorId" value="incrementTweetNumber"/>
+        </service-properties>
+        <bean class="org.apache.unomi.examples.unomi_tweet_button_plugin.actions.IncrementTweetNumberAction">
+            <property name="profileService" ref="profileService"/>
+        </bean>
+    </service>
+</blueprint>
+----
+
+In standard Blueprint fashion, we specify that we will need the `profileService` defined by Unomi and then define a service of our own to be exported for Unomi to use. Our service specifies one property: `actionExecutorId` which matches the identifier we specified in our action definition. We then inject the profile service in our executor and we're done for the configuration side of things!
+
+===== Action executor implementation
+
+Our action executor definition specifies that the bean providing the service is implemented in the https://github.com/apache/incubator-unomi/blob/master/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java[`org.apache.unomi.samples.tweet_button_plugin.actions
+.IncrementTweetNumberAction`] class. This class implements the Unomi `ActionExecutor` interface which provides a single `int execute(Action action, Event event)` method: the executor gets the action instance to execute along with the event that triggered it, performs its work and returns an integer status corresponding to what happened as defined by public constants of the `EventService` interface of Unomi: `NO_CHANGE`, `SESSION_UPDATED` or `PROFILE_UPDATED`.
+
+Let's now look at the implementation of the method:
+
+[source,java]
+----
+final Profile profile = event.getProfile();
+Integer tweetNb = (Integer) profile.getProperty(TWEET_NB_PROPERTY);
+List<String> tweetedFrom = (List<String>) profile.getProperty(TWEETED_FROM_PROPERTY);
+
+if (tweetNb == null || tweetedFrom == null) {
+    // create tweet number property type
+    PropertyType propertyType = new PropertyType(new Metadata(event.getScope(), TWEET_NB_PROPERTY, TWEET_NB_PROPERTY, "Number of times a user tweeted"));
+    propertyType.setValueTypeId("integer");
+    service.createPropertyType(propertyType);
+
+    // create tweeted from property type
+    propertyType = new PropertyType(new Metadata(event.getScope(), TWEETED_FROM_PROPERTY, TWEETED_FROM_PROPERTY, "The list of pages a user tweeted from"));
+    propertyType.setValueTypeId("string");
+    propertyType.setMultivalued(true);
+    service.createPropertyType(propertyType);
+
+    tweetNb = 0;
+    tweetedFrom = new ArrayList<>();
+}
+
+profile.setProperty(TWEET_NB_PROPERTY, tweetNb + 1);
+final String sourceURL = extractSourceURL(event);
+if (sourceURL != null) {
+    tweetedFrom.add(sourceURL);
+}
+profile.setProperty(TWEETED_FROM_PROPERTY, tweetedFrom);
+
+return EventService.PROFILE_UPDATED;
+----
+
+It is fairly straightforward: we retrieve the profile associated with the event that triggered the rule and check whether it already has the properties we are interested in. If not, we create the associated property types and initialize the property values.
+
+____
+
+Note that it is not an issue to attempt to create the same property type multiple times as Unomi will not add a new property type if an identical type already exists.
+
+____
+
+Once this is done, we update our profile with the new property values based on the previous values and the metadata extracted from the event using the `extractSourceURL` method which uses our `url` property that we've specified for our event source. We then return that the profile was updated as a result of our action and Unomi will properly save it for us when appropriate. That's it!
+
+For reference, here's the `extractSourceURL` method implementation:
+
+[source,java]
+----
+private String extractSourceURL(Event event) {
+    final Item sourceAsItem = event.getSource();
+    if (sourceAsItem instanceof CustomItem) {
+        CustomItem source = (CustomItem) sourceAsItem;
+        final String url = (String) source.getProperties().get("url");
+        if (url != null) {
+            return url;
+        }
+    }
+
+    return null;
+}
+----
+
+=== Conclusion
+
+We have seen a simple example how to interact with Unomi using a combination of client-side code and Unomi plugin. Hopefully, this provided an introduction to the power of what Unomi can do and how it can be extended to suit your needs.
+
+=== Annex
+
+Here is an overview of how Unomi processes incoming requests to the `ContextServlet`.
+image:../../images/unomi-request.png[Unomi request overview]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/archives/1.2/asciidoc/samples/weather-update-sample.adoc
----------------------------------------------------------------------
diff --git a/manual/src/archives/1.2/asciidoc/samples/weather-update-sample.adoc b/manual/src/archives/1.2/asciidoc/samples/weather-update-sample.adoc
new file mode 100644
index 0000000..e4a79d9
--- /dev/null
+++ b/manual/src/archives/1.2/asciidoc/samples/weather-update-sample.adoc
@@ -0,0 +1,15 @@
+//
+// Licensed 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.
+//
+
+=== Weather update sample
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/main/asciidoc/apache.css
----------------------------------------------------------------------
diff --git a/manual/src/main/asciidoc/apache.css b/manual/src/main/asciidoc/apache.css
index e66d1fa..2872ec3 100644
--- a/manual/src/main/asciidoc/apache.css
+++ b/manual/src/main/asciidoc/apache.css
@@ -1,5 +1,5 @@
 
-@import "https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700%7cDroid+Serif:400,700";
+@import "https://fonts.googleapis.com/css?family=Open+Sans:400,700%7cDroid+Serif:400,700";
 
 article,
 aside,
@@ -384,7 +384,7 @@ h3,
 h4,
 h5,
 h6 {
-    font-family: "Source Sans Pro", "DejaVu Sans", sans-serif;
+    font-family: "Open Sans", "DejaVu Sans", sans-serif;
     font-weight: bold;
     /*font-style: bold;*/
     color: #303284;
@@ -1233,7 +1233,7 @@ table.tableblock #preamble>.sectionbody>[class="paragraph"]:first-of-type p {
 
 .admonitionblock>table td.icon .title {
     font-weight: bold;
-    font-family: "Source Sans Pro", "DejaVu Sans", sans-serif;
+    font-family: "Open Sans", "DejaVu Sans", sans-serif;
     text-transform: uppercase
 }
 
@@ -1507,7 +1507,7 @@ table.pyhltable .linenodiv {
 }
 
 .verseblock pre {
-    font-family: "Source Sans Pro", "DejaVu Sans", sans;
+    font-family: "Open Sans", "DejaVu Sans", sans;
     font-size: 1.15rem;
     color: rgba(0, 0, 0, .85);
     font-weight: 300;
@@ -2183,7 +2183,7 @@ a span.icon>.fa {
     width: 1.67em;
     height: 1.67em;
     line-height: 1.67em;
-    font-family: "Source Sans Pro", "DejaVu Sans", sans-serif;
+    font-family: "Open Sans", "DejaVu Sans", sans-serif;
     font-style: normal;
     font-weight: bold
 }

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/apache-theme.yml
----------------------------------------------------------------------
diff --git a/manual/src/theme/apache-theme.yml b/manual/src/theme/apache-theme.yml
index 855b46c..cc901d6 100644
--- a/manual/src/theme/apache-theme.yml
+++ b/manual/src/theme/apache-theme.yml
@@ -1,11 +1,24 @@
+##
+## Licensed 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.
+##
 font:
   catalog:
-    #SourceSansPro
-    SourceSansPro:
-      normal: SourceSansPro-Regular.ttf
-      italic: SourceSansPro-Italic.ttf
-      bold: SourceSansPro-Bold.ttf
-      bold_italic: SourceSansPro-BoldItalic.ttf
+    #OpenSans
+    OpenSans:
+      normal: OpenSans-Regular.ttf
+      italic: OpenSans-Italic.ttf
+      bold: OpenSans-Bold.ttf
+      bold_italic: OpenSans-BoldItalic.ttf
     #DroidSerif
     DroidSerif:
       normal: DroidSerif-Regular.ttf
@@ -68,7 +81,7 @@ heading:
   align: left
   font_color: #303284
   #font_color: $base_font_color
-  font_family: SourceSansPro
+  font_family: OpenSans
   font_style: bold
   text_transform: uppercase
   # h1 is used for part titles (book doctype only)

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-Black.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-Black.ttf b/manual/src/theme/fonts/SourceSansPro-Black.ttf
deleted file mode 100644
index 7ea0260..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-Black.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-BlackItalic.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-BlackItalic.ttf b/manual/src/theme/fonts/SourceSansPro-BlackItalic.ttf
deleted file mode 100644
index e1a7482..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-BlackItalic.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-Bold.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-Bold.ttf b/manual/src/theme/fonts/SourceSansPro-Bold.ttf
deleted file mode 100644
index f698646..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-Bold.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-BoldItalic.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-BoldItalic.ttf b/manual/src/theme/fonts/SourceSansPro-BoldItalic.ttf
deleted file mode 100644
index 5c00b64..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-BoldItalic.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-ExtraLight.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-ExtraLight.ttf b/manual/src/theme/fonts/SourceSansPro-ExtraLight.ttf
deleted file mode 100644
index f1da6b2..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-ExtraLight.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-ExtraLightItalic.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-ExtraLightItalic.ttf b/manual/src/theme/fonts/SourceSansPro-ExtraLightItalic.ttf
deleted file mode 100644
index 15f7344..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-ExtraLightItalic.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-Italic.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-Italic.ttf b/manual/src/theme/fonts/SourceSansPro-Italic.ttf
deleted file mode 100644
index 82e8762..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-Italic.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-Light.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-Light.ttf b/manual/src/theme/fonts/SourceSansPro-Light.ttf
deleted file mode 100644
index ea1104b..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-Light.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-LightItalic.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-LightItalic.ttf b/manual/src/theme/fonts/SourceSansPro-LightItalic.ttf
deleted file mode 100644
index b78f1b0..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-LightItalic.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-Regular.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-Regular.ttf b/manual/src/theme/fonts/SourceSansPro-Regular.ttf
deleted file mode 100644
index 278ad8a..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-Regular.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-SemiBold.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-SemiBold.ttf b/manual/src/theme/fonts/SourceSansPro-SemiBold.ttf
deleted file mode 100644
index ac3e0d1..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-SemiBold.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro-SemiBoldItalic.ttf
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro-SemiBoldItalic.ttf b/manual/src/theme/fonts/SourceSansPro-SemiBoldItalic.ttf
deleted file mode 100644
index b0737bb..0000000
Binary files a/manual/src/theme/fonts/SourceSansPro-SemiBoldItalic.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b077d27b/manual/src/theme/fonts/SourceSansPro_OFL.txt
----------------------------------------------------------------------
diff --git a/manual/src/theme/fonts/SourceSansPro_OFL.txt b/manual/src/theme/fonts/SourceSansPro_OFL.txt
deleted file mode 100644
index 72d81ab..0000000
--- a/manual/src/theme/fonts/SourceSansPro_OFL.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-Copyright 2010, 2012, 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name ‘Source’.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded, 
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.