This is an automated email from the ASF dual-hosted git repository. sergehuber pushed a commit to branch UNOMI-932-unomi3-major-release-story in repository https://gitbox.apache.org/repos/asf/unomi-site.git
commit c695e4db506269e574a5cb3d7dcb3558eb607481 Author: Serge Huber <[email protected]> AuthorDate: Thu Jul 16 11:46:43 2026 +0200 Fix shell blog examples to match live Unomi 3 CRUD syntax (UNOMI-932) Expand profile/session/event walkthroughs, drop removed classic commands, and add a compact Blog "New" nav badge. --- src/main/webapp/_layouts/default.html | 4 +- src/main/webapp/assets/css/unomi.css | 24 +++++ src/main/webapp/blog/unomi-3-shell-commands.html | 125 +++++++++++++++++++---- 3 files changed, 133 insertions(+), 20 deletions(-) diff --git a/src/main/webapp/_layouts/default.html b/src/main/webapp/_layouts/default.html index bc6aad3..194efe5 100644 --- a/src/main/webapp/_layouts/default.html +++ b/src/main/webapp/_layouts/default.html @@ -212,7 +212,9 @@ <a class="nav-link fw-medium" href="/get-started.html">Get Started</a> </li> <li class="nav-item"> - <a class="nav-link fw-medium" href="/blog/">Blog</a> + <a class="nav-link fw-medium" href="/blog/" aria-label="Blog (new)"> + Blog<span class="nav-badge-new" aria-hidden="true">New</span> + </a> </li> <!-- Documentation Dropdown --> diff --git a/src/main/webapp/assets/css/unomi.css b/src/main/webapp/assets/css/unomi.css index 6e9de89..1a28f81 100644 --- a/src/main/webapp/assets/css/unomi.css +++ b/src/main/webapp/assets/css/unomi.css @@ -201,6 +201,30 @@ textarea:focus-visible, background: var(--unomi-primary-light); } +/* Compact "New" indicator on nav items (e.g. Blog) */ +.nav-badge-new { + display: inline-block; + margin-left: 0.4rem; + padding: 0.15em 0.4em; + font-size: 0.6rem; + font-weight: 700; + letter-spacing: 0.05em; + line-height: 1; + vertical-align: 0.12em; + text-transform: uppercase; + color: var(--unomi-primary-dark); + background: var(--unomi-primary-light); + border: 1px solid var(--unomi-primary-border-light); + border-radius: 0.25rem; +} + +.navbar-nav .nav-link:hover .nav-badge-new, +.navbar-nav .nav-link.active .nav-badge-new { + color: var(--unomi-primary-dark); + background: var(--unomi-white); + border-color: var(--unomi-primary-border-light); +} + .dropdown-menu { min-width: 16rem; border: 1px solid var(--unomi-border); diff --git a/src/main/webapp/blog/unomi-3-shell-commands.html b/src/main/webapp/blog/unomi-3-shell-commands.html index 1e1b6e8..148e6ed 100644 --- a/src/main/webapp/blog/unomi-3-shell-commands.html +++ b/src/main/webapp/blog/unomi-3-shell-commands.html @@ -50,30 +50,117 @@ layout: default <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code>ssh -p 8102 karaf@localhost # default user/pass: karaf/karaf (change etc/users.properties ASAP) -unomi:<TAB> # list commands -help unomi:crud -help unomi:cache</code></pre> +unomi:<TAB> # list commands +unomi:crud help profile # type cheat-sheet (also: rule, session, event, tenant, ...) +unomi:version +unomi:cache --stats</code></pre> <h2 class="h4 mt-5 mb-3">Tenant context first</h2> - <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code>unomi:tenant-set acme + <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code># Create a tenant (generates public + private API keys) +unomi:crud create tenant '{"itemId":"acme","name":"Acme Corp"}' +unomi:crud list tenant + +unomi:tenant-set acme unomi:tenant-get # subsequent CRUD / cache commands use this tenant</code></pre> <h2 class="h4 mt-5 mb-3">Unified CRUD</h2> - <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code>unomi:crud help rule + <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code># Verbs: create | read | update | delete | list | help +# Bodies are positional JSON or a file:// URL (not --file / -d flags) + +unomi:crud help rule unomi:crud list rule --csv -n 50 unomi:crud read rule my-rule-id -unomi:crud create rule --file /tmp/rule.json -unomi:crud update rule my-rule-id -d='{"itemId":"my-rule-id","enabled":false}' + +# Rules use metadata for name/enabled (not top-level name/enabled) +unomi:crud create rule file:///tmp/rule.json +unomi:crud create rule '{"itemId":"my-rule-id","metadata":{"id":"my-rule-id","name":"My rule","enabled":true},"condition":{"type":"matchAllCondition","parameterValues":{}},"actions":[]}' +unomi:crud update rule my-rule-id '{"itemId":"my-rule-id","metadata":{"id":"my-rule-id","name":"My rule","enabled":false},"condition":{"type":"matchAllCondition","parameterValues":{}},"actions":[]}' unomi:crud delete rule my-rule-id -unomi:crud list tenant -unomi:crud create apikey -d='{"tenantId":"acme","keyType":"PRIVATE"}' +unomi:crud create apikey '{"tenantId":"acme","keyType":"PRIVATE"}' +# plaintext key is printed once — store it immediately + unomi:crud list profile -n 20 unomi:crud list schema # when json-schema extension is present</code></pre> <h3 class="h6 mt-4 mb-2">Object types registered for <code>unomi:crud</code></h3> <p class="small text-muted"><code>actiontype</code>, <code>apikey</code>, <code>campaign</code>, <code>campaignevent</code>, <code>conditiontype</code>, <code>consent</code>, <code>event</code>, <code>goal</code>, <code>persona</code>, <code>profile</code>, <code>profilealias</code>, <code>propertytype</code>, <code>rule</code>, <code>rulestats</code>, <code>scope</code>, <code>scoring</code>, <code>segment</code>, <code>session</code>, <code>tenant</code>, <code>topic</code>, pl [...] + <p class="small text-muted mb-0">Use <code>unomi:crud help <type></code> for the property cheat-sheet of that type (required fields, optional maps, common event types).</p> + + <h2 class="h4 mt-5 mb-3">Profiles, sessions, and events</h2> + <p>Day-to-day operator work often means inspecting or patching customer data in a tenant. + Set the tenant once, then use the same <code>unomi:crud</code> verbs on <code>profile</code>, <code>session</code>, and <code>event</code>.</p> + + <h3 class="h6 mt-4 mb-2">Profiles</h3> + <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code># Discover shape + recent profiles (sorted by lastUpdated / lastVisit) +unomi:crud help profile +unomi:crud list profile -n 20 +unomi:crud list profile --csv -n 50 + +# Full JSON dump of one profile +unomi:crud read profile PROFILE_ID + +# Create (top-level keys become profile properties; itemId is the profile id) +unomi:crud create profile '{"itemId":"demo-ada","firstName":"Ada","lastName":"Lovelace","email":"[email protected]"}' + +# Or from a file +unomi:crud create profile file:///tmp/profile-ada.json + +# Update replaces the profile properties map with the JSON you pass +# (include every property you want to keep) +unomi:crud update profile demo-ada '{"firstName":"Ada","lastName":"Lovelace","email":"[email protected]","company":"Analytical Engines"}' + +# Remove +unomi:crud delete profile demo-ada</code></pre> + <p class="small text-muted">There are no separate <code>profile-list</code> / <code>profile-view</code> commands in Unomi 3 — use <code>unomi:crud list|read|delete profile</code>.</p> + + <h3 class="h6 mt-4 mb-2">Sessions</h3> + <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code>unomi:crud help session +unomi:crud list session -n 20 +unomi:crud read session SESSION_ID + +# Create a session bound to a profile (ISO-8601 timestamps) +unomi:crud create session '{"itemId":"demo-session-1","profileId":"demo-ada","scope":"myscope","timeStamp":"2026-07-15T10:00:00Z","properties":{"origin":"shell-demo"}}' + +# Update session metadata / properties (full session document) +unomi:crud update session demo-session-1 '{"itemId":"demo-session-1","profileId":"demo-ada","scope":"myscope","timeStamp":"2026-07-15T10:00:00Z","lastEventDate":"2026-07-15T10:05:00Z","properties":{"origin":"shell-demo","channel":"web"}}' + +unomi:crud delete session demo-session-1</code></pre> + <p class="small text-muted">Required fields for create: <code>itemId</code>, <code>profileId</code>, <code>timeStamp</code>, <code>scope</code>. Use <code>unomi:crud list|read session</code> (the old <code>session-list</code> / <code>session-view</code> commands are gone).</p> + + <h3 class="h6 mt-4 mb-2">Events</h3> + <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code>unomi:crud help event +unomi:crud list event -n 50 +unomi:crud read event EVENT_ID + +# Send / persist a view event (create goes through EventService.send) +unomi:crud create event '{"itemId":"demo-event-1","eventType":"view","scope":"myscope","profileId":"demo-ada","sessionId":"demo-session-1","source":{"itemType":"site","scope":"myscope","itemId":"mysite"},"target":{"itemType":"page","scope":"myscope","itemId":"homepage"},"properties":{"pageInfo":{"pagePath":"/home"}},"persistent":true}' + +# Re-send / update the same event id with new properties +unomi:crud update event demo-event-1 '{"itemId":"demo-event-1","eventType":"view","scope":"myscope","profileId":"demo-ada","sessionId":"demo-session-1","source":{"itemType":"site","scope":"myscope","itemId":"mysite"},"target":{"itemType":"page","scope":"myscope","itemId":"checkout"},"properties":{"pageInfo":{"pagePath":"/checkout"}},"persistent":true}' + +unomi:crud delete event demo-event-1 + +# Prefer file:// for larger payloads +unomi:crud create event file:///tmp/view-event.json</code></pre> + <p class="small text-muted">Common <code>eventType</code> values include <code>view</code>, <code>form</code>, <code>login</code>, <code>identify</code>, <code>modifyConsent</code>, <code>sessionCreated</code>, <code>profileUpdated</code>. + For live traffic use <code>unomi:event-tail</code>; for history use <code>unomi:crud list|read event</code> (legacy <code>event-list</code> / <code>event-search</code> were replaced by CRUD).</p> + + <h3 class="h6 mt-4 mb-2">Typical inspect loop</h3> + <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code>unomi:tenant-set acme + +# Who showed up recently? +unomi:crud list profile -n 10 + +# Open one profile, then its latest sessions / events +unomi:crud read profile demo-ada +unomi:crud list session -n 10 +unomi:crud list event -n 20 + +# Live: watch events and rule hits while you reproduce in the browser +unomi:event-tail +unomi:rule-tail</code></pre> <h2 class="h4 mt-5 mb-3">Cache</h2> <pre class="code-block-light p-3 rounded-3 small overflow-auto"><code>unomi:cache --stats @@ -81,8 +168,8 @@ unomi:cache --stats --detailed --tenant acme unomi:cache --stats --type profile --csv unomi:cache --clear --tenant acme unomi:cache --inspect -unomi:cache --view --id ENTRY_ID --type … --tenant acme -unomi:cache --remove --id ENTRY_ID --type … --tenant acme +unomi:cache --view --id ENTRY_ID --type TYPE --tenant acme +unomi:cache --remove --id ENTRY_ID --type TYPE --tenant acme unomi:cache --watch 5</code></pre> <h2 class="h4 mt-5 mb-3">Scheduler (shell twin of REST)</h2> @@ -95,16 +182,16 @@ unomi:task-purge --days 14 --force unomi:task-executor</code></pre> <h2 class="h4 mt-5 mb-3">Still there: live debugging & lifecycle</h2> + <p>Dedicated list/view/remove commands for profiles, sessions, events, rules, segments, actions, and conditions were folded into <code>unomi:crud</code>. + What remains as first-class commands:</p> <ul> - <li><code>rule-list|view|remove|reset-stats|tail|watch</code></li> - <li><code>event-tail|view|list|search</code></li> - <li><code>action-list|view</code>, <code>condition-list|view</code></li> - <li><code>profile-list|view|remove</code>, <code>segment-*</code>, <code>session-*</code></li> - <li><code>list-invalid-objects</code></li> - <li><code>deploy-definition</code> / <code>undeploy-definition</code></li> - <li><code>setup</code>, <code>migrate</code>, <code>start</code>, <code>stop</code>, <code>version</code></li> + <li><code>unomi:rule-reset-stats</code>, <code>unomi:rule-tail</code>, <code>unomi:rule-watch RULE_ID…</code></li> + <li><code>unomi:event-tail</code> (live stream; Ctrl+C to stop)</li> + <li><code>unomi:list-invalid-objects</code></li> + <li><code>unomi:deploy-definition</code> / <code>unomi:undeploy-definition</code></li> + <li><code>unomi:setup</code>, <code>unomi:migrate</code>, <code>unomi:start</code>, <code>unomi:stop</code>, <code>unomi:version</code></li> </ul> - <p>Many day-to-day inspect/edit flows now go through <code>unomi:crud</code>; the dedicated list/view/remove commands remain useful for scripting habits and live tails.</p> + <p>Day-to-day inspect/edit for profiles, sessions, events, rules, segments, and the rest goes through <code>unomi:crud</code>; use the tails when you need a live console feed.</p> <p class="mt-4"> <a class="btn btn-primary" href="{{ site.data.unomi.manual.published_latest }}#_shell_commands">Manual: shell commands</a>
