Introducing new BloomReach Experience Plugins which changes the game of DREAM (Digital Relevance Experience & Agility Management), to increase productivity and business agility.
1. Relevance Trilogy:
May DREAM be with you!
Woonsan Ko
December 6, 2017
(By courtesy of Matthias Ripp, licensed by CC BY 2.0)
2. Find all the resources including this presentation:
● slideshare.net/woonsan
● woonsanko.blogspot.com
Relevance Trilogy Demo Project:
● github.com/WoonsanKo/relevance-trilogy-demo
6. Digital Relevance Experience & Agility Management
6
business
expert
developer
webmaster
Slow, Difficult and Costly
to realize relevant data
collections!
7. Digital Relevance Experience & Agility Management
7
business
expert
developer
webmaster
How to apply to
Headless Scenarios?
8. Digital Relevance Experience & Agility Management
8
business
expert
developer
webmaster
A “hacky variation”?
(JSON aggregation
from Page/Components?)
9. 9
● The 3 Questions
Digital Relevance Experience & Agility Management
Chapter 1 on “How to make Define phase faster and more cost-effective?”
Chapter 2 on “How to Apply Relevance to Headless Scenarios?”
Chapter 3 on “A ‘hacky variation’? JSON Aggregation from Page/Components?
Any alternatives?”
10. DREAM on EIRE*
10
Chapter 1.
* More at https://www.onehippo.org/library/enterprise/services-features/inference-engine/introduction.html
11. What’s happening today?
11
BloomReach DXP
visitor
business expert
webmaster
developer
Delivery tier
Authoring tier
FooCollector
FooScorer
FooCharacteristicPlugin
FooCollectorPlugin
Targeting
Service
Characteristics
Experience
Optimizer
Alter Ego
What’s going on
with my foo data
collection?
Well, I’ve been
doing my best
to implement
the Classes and
ExtJS stuffs!
12. Why Expressional Inference Rule Engine?
● Simple “Forward-chaining*” Inference Engine which executes expressions of Rules
to deduce Goal Values from Available Data.
○ Goal Values : Primary Goal Value and optional Extra (Secondary) Goal Value(s).
■ e.g, “news” type is the primary goal value while hit counters can be extra goal values.
( = { “news”: 3, “events”: 2, “unknown”: 1 })
12
Data from Visitor
Available
Data
Data from Environment
Data from
Knowledge Base
IF reads news pages most often,
THEN X is “news”.
IF reads events pages most often,
THEN X is “events”.
ELSE X is “unknown”.
Available
Data
Primary Goal value
(“news”, “events”,
or “unknown”),
and optional
Extra Goal value(s)
Expressional Inference
Rule Engine
Primary Goal value
* More at https://en.wikipedia.org/wiki/Forward_chaining
13. Why Expressional Inference Rule Engine? (cont.)
13
HTTP vars
Geographic vars
Weather vars
SalesForce / Marketo vars
Variable X, Y, Z, ...
Expressional
Inference
Rule Engine
BloomReach DXP
Rules
Expression
Document
(w/ JEXL*)
business
expert
visitor
<<personalized / relevant content>>
Rule-based
Generic
Collector
Personalized
Content Delivery
Input vars
in the world
Deduced
business
goal vars
AI-powered analytic vars developer
* More at http://commons.apache.org/proper/commons-jexl/
14. How it works?
14
Define all the
“inference goal” values
to the business.
Those are to be shown
in Characteristics
plugin automatically!
Targeting collector will
be in the same lifecycle
of this document
publication lifecycle!
Configure the collector
plugin’s icon here!
Parameters can be
defined and accessed in
expressions through
$.getParameter() or
$.getParameterValues().
15. How it works? (cont.)
15
As you defined the
possible “inference
goal” values to
deduce!
16. How it works? (cont.)
16
Select your
“inference rule”
based
characteristic to
personalize!
17. Expressional Inference Rule Engine
● Inference Rules Expression Script Engine (black-boxed JEXL Sandbox)
○ Built-in Objects and Built-in Namespace Functions
○ Support Custom POJOs / Custom Namespace Functions
■ You can integrate with any backends!
● Primary Goal Targeting Data Value (from return value)
● Extra (Secondary) Goal Targeting Data Values
○ Via $.collectorContext built-in object
17* More at http://commons.apache.org/proper/commons-jexl/
18. Expressional Inference Rule Engine - Simple Example
18
// Suppose you need to classify the visitor based on CRM data (rank and industry)
// and visitor’s continent determined by GeoIP service.
//
// Example Classified Primary Goal Values: [ “non-eu-star”, “eu-star” ]
//
var location = geolocation:getLocation($.request.remoteAddr);
var email = $.request.cookies[“email”];
var crmService = $.request.getAttribute(“crmService”);
var lead = crmService.findLeadByEmail(email);
if (lead.rank == “Hot” && lead.industry == “Sports”) {
if (location.continentCode == “AF” && location.continentCode == “AS”) {
return "non-eu-star";
} else if (location.continentCode == “EU”) {
return "eu-star";
}
}
return null;
20. Built-in Namespace Functions
20
Built-in Function Description
string: String utilities. e.g, string:split("Hello, World!", ",");
date: Date utilities provided by Commons Lang.
number: Number utilities provided by Commons Lang.
counter: Counting utilities. For example, it provides utilities to increment counter by key in a map.
e.g, var map = counter:newMap(); counter:increment(map, "key1");
regex: Regular expression utilities that provide compiling both regex and glob expressions.
json: JSON utilities providing parsed JSONObject or JSONArray objects.
geolocation: GEO Location utilities to find location by client IP address.
... ...
21. Custom Object Attribute / Custom Function Support
● Custom Objects
○ Register it in the Add-on Spring Assembly Override XML.
○ Get the attribute in expressions: $.getAttribute(name)
● Custom Namespace Functions
○ Register it in the Add-on Spring Assembly Override XML.
○ Use it like ns1:func(...) in expressions.
21
22. What’s going to happen now?
22
BloomReach DXP
visitor
business expert
webmaster
developer
Delivery
tier
Authoring
tier
Custom POJO
Objects /
Functions
Targeting
Service
Characteristics
Experience
Optimizer
Alter Ego
business expert
Wow, it’s just working!
We can already apply
and monitor it !!!
Cool! You can even edit,
republish the rules in
CMS at runtime!
WE DID IT!
EIRE
Foo
Inf.
Rules
23. 23
Chapter 2.
ROCK Headless with AC!DC*
(By courtesy of Laurel F,
licensed by CC BY-SA 2.0)
* More at https://www.onehippo.org/library/enterprise/services-features/api-agent-channel/introduction.html
24. Can we apply Relevance in Headless Scenario?
24
BloomReach DXP
visitor
business expert
webmaster
Delivery
tier
REST API
Mount
Website
Mount
Website
Channel
Frontend App
No REST
Channel!
<<rest>>
What?! There’s no
Channel for REST?
Well, REST API
doesn’t have channel,
components, so what
can I do?
25. Create AC!DC* Channel for REST API Mount
25* More at https://www.onehippo.org/library/enterprise/services-features/api-agent-channel/introduction.html
Since v12.1, built-in
Swagger API doc
(/swagger.{yaml|json}) is
supported out-of-box!
26. Personalize Plain JAX-RS Services
● Use @ParametersInfo annotation in JAX-RS.
● Use @Context ParametersInfoProvider to read (personalized) parameters.
26
@Path(“/products/”) // JAX-RS annotation
@Api(value=”Products”) // Swagger annotation
@ParametersInfo(type = ProductParametersInfo.class) // HST-2 annotation
public class ProductResources extends AbstractResource {
@GET
@Path("/search/")
@ApiOperation(value="Finds products", response=ProductRepresentation.class, responseContainer="List")
public List<ProductRepresentation> searchProductResources(
@Context HttpServletRequest servletRequest,
@Context ParametersInfoProvider paramsInfoProvider,
@QueryParam("brand") String brand, ...) {
// read ParametersInfo and personalize query params like you do usually in HstComponents!
ProductParametersInfo paramsInfo = paramsInfoProvider.getParametersInfo();
String scopePath = paramsInfo.getScopePath();
String sortInfo = paramsInfo.getSortInfo();
// ...
}
}
30. 30
BloomReach DXP
business expert
webmaster
Delivery
tier
REST API
Mount
Website
Mount
Website
Channel
Wow, seamless headless!
We can personalize
REST API visitors, too!
WE DID IT! (2)
What’s going to happen now?
visitor
Frontend App
<<rest>>
Awesome! You can even
test with different variant
params with Swagger!
AC!DC
Channel
31. GREB* on SPA
31
Chapter 3.
* More at https://www.onehippo.org/library/enterprise/services-features/greb-api/introduction.html
32. Custom JSON Writing in FTL? (“hacky variant”)
32
BloomReach DXP
business expert
webmaster
Delivery
tier
FTL
Templates
writing JSON
Website
Mount
Website
Channel
Well, then can I write
custom JSON output
in templates?
What?! There’s
no Channel for
REST?
<#-- news-list.ftl -->
{
“container”: [
<@hst.include ref=”container” />
]
}
<#-- news-item.ftl -->
{
“title”: “The Medusa News”,
“date”: “2017-12-06”,
“content”: “Lorem Ipsum..."
}
No API
Mount!
visitor
Frontend App
<<rest>>
33. Custom JSON Writing in FTL? (“hacky variant”)
● Problems with custom JSON writing in templates
○ Error prone in JSON serialization
○ No POJO mapping framework (e.g, Jackson2)
○ More templating work
33
(By courtesy of Dave O,
licensed by CC BY-SA 2.0)
34. Why GREB (Generic Resource Entity Builder) API?
34
Simply contribute
POJOs, HST Beans,
etc. through GREB in
#doBeforeRender().
Separate GREB API Mount (and
Channel) with GREB Pipeline,
which writes an aggregated
JSON output using Jackson2
(no template rendering)!
38. When to Use GREB API*?
● JSON API output based on Page Composition
○ E.g, Just as a glue between SPA and Page Aggregation.
● Quick JSON API Provision
○ Taking advantage of Jackson2 JSON Mapping.
○ When API-First approach is not necessary.
38
(By courtesy of Ferran Pestaña,
licensed by CC BY-SA 2.0)
* More at https://www.onehippo.org/library/enterprise/services-features/greb-api/introduction.html
39. 39
Wow, how simple it is!
We produce a flexible
JSON API easily!
Love Jackson2 mapping!
It’s very easy to expose
JSON API with POJOs,
HST Beans, etc.
WE DID IT! (3)
What’s going to happen now?
BloomReach DXP
business expert
webmaster
Delivery
tier
Website
Mount
Website
Channel
visitor
Frontend App
<<rest>>
GREB API
Mount
40. “The only one who could ever reach me
Was the son of a DREAMer man.”
40
Epilogue
41. 41
business
expert
Developer
webmaster
EIRE enables
Fast, Agile and
Cost-effective!
DREAM Coming True
API Agent Channel enables
Seamless Relevance Integration in
Headless Scenarios
GREB API provides a
safe, robust alternatives
to the “hacky variation”.
42. Stay in Touch!
● www.onehippo.org
● slideshare.net/woonsan
● woonsanko.blogspot.com