We are doing some work on integrating AEM as the CMS connection in a Salesforce Lightning Community page using CMS Connect and the Lightning Builder but have run into some issues with the Locker Service security layer for our use-case and are hoping you can provide some assistance.
We currently have the CMS connection set-up so that a path can be specified in the Community Builder to our AEM hosted servlet which will return the correct markup and CSS/JS client-libs for the requested component which renders as expected in the builder. However, we found that Locker Service segregates these returned assets into an isolated DOM container context and restricts the JS of this component from accessing any elements that may be rendered on the actual page's DOM.
The use case we have where the Locker Service's isolating behavior is causing problems is we want to be able to provide a JS file with our top-nav header component that can do the following: Access the actual page DOM and interact with and modify the top-nav component elements that may are rendered on the page. Expose public JS functions that can be called with arguments that are later defined on the builder page. Have the JS be accessible from the actual page DOM and can be called and executed there with access to the real DOM. We'd like to be able to do the above so that a Community page builder in Salesforce has the ability to specify different customizable content that will be injected into the pulled-in top-nav header CMS Connect component.
In one of the webinars we attended there was a mention of Lightning Events that allows components to talk to each other. Would this be the correct approach to support the above use-case and solve the problems we are running into?
Or is there something we are missing or perhaps a different method where this can be done more easily?