[MGNLCACHE-235] CLONE - Version events fired in all workspaces Created: 18/Sep/20 Updated: 25/Sep/20 Resolved: 23/Sep/20 |
|
| Status: | Closed |
| Project: | Cache Modules |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.9.2, 5.6.5 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Richard Gange | Assignee: | Federico Grilli |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | maintenance, versioning | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Epic Link: | Support | ||||||||
| Sprint: | Maintenance 26 | ||||||||
| Story Points: | 0 | ||||||||
| Description |
|
When a page or asset is versioned a node added event occurs in all workspaces. The versions can be visually inspected from the JCR Browser: Set true: /modules/jcr-browser-app/apps/jcr-browser/subApps/browser/contentConnector@includeSystemNodes This screenshots one example of a page version and one example of an asset version: Asset in messages wksp Expected Actual Result To see the issue create this groovy script in the package structure info.magnolia.test: package info.magnolia.test; import javax.jcr.observation.*; import javax.jcr.RepositoryException; import javax.jcr.observation.Event; import info.magnolia.observation.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class NodeAddedEvent implements EventListener { private static final Logger log = LoggerFactory.getLogger(NodeAddedEvent.class); private String workspace = ""; public NodeAddedEvent(String workspace) { log.info("Worksapce listener registered: {}", workspace); this.workspace = workspace; } @Override public void onEvent(EventIterator events) { while (events.hasNext()) { Event event = events.nextEvent(); if (event.getType() == Event.NODE_ADDED) try { log.info("Node added to {}: {}", workspace, event.getPath()); } catch (RepositoryException e) { e.printStackTrace(); } } } } workspaces = [ "advancedCache", "campaigns", "category", "config", "dam", "imaging", "keystore", "marketing-tags", "messages", "magnolia-mgnlSystem", "magnolia-mgnlVersion", "personas", "profiles", "rankings", "resources", "rss", "scripts", "segments", "stories", "tags", "tasks", "usergroups", "userroles", "users", "visitors", "website", "workflow" ]; for (workspace : workspaces) { println workspace; (WorkspaceEventListenerRegistration .observe(workspace, "/", new NodeAddedEvent(workspace)) .withSubNodes(true)).register(); } Create a page and publish it. The NodeAddedEvent will log every new node created. [^page-node-creation-and-publish.log] Conclusions
|
| Comments |
| Comment by Federico Grilli [ 21/Sep/20 ] |
|
|