Shashi
Shashi

Reputation: 746

What is CQ.Ext object in AEM

I've recently came to find out about CQ.Ext object in AEM, and how it's available in author mode and not in publish mode.

my first guess would be it's related to extjs widgets library, but precisely, what is CQ.Ext object and what does it do. Additionally, as Author and publish are run modes, if i start aem in any custom runmode, will this CQ.Ext object available to me. if not, how would i make it available in my custom runmode in aem.

Thanks in advance.

Upvotes: 0

Views: 557

Answers (1)

Shawn
Shawn

Reputation: 9472

It is pulled in as part of a client library. When you write code that uses the foundation AEM libs, some of those core JSPs have code that pull different client libraries onto the page if the page is loaded in publish mode or not. So really, the key is to include it if/when you need to use it. Here is some example code from one of the foundation libs JSPs that shows how client libraries are conditionally included depending on the WCM mode. An AEM instance running as a publisher will have a DISABLED WCM mode, while an instance running as an author will have something like EDIT:

if (WCMMode.fromRequest(request) != WCMMode.DISABLED) {
        String dlgPath = null;
        if (editContext != null && editContext.getComponent() != null) {
            dlgPath = editContext.getComponent().getDialogPath();
        }
        if (AuthoringUIMode.fromRequest(slingRequest) == AuthoringUIMode.TOUCH) {
            %><cq:includeClientLib categories="cq.authoring.page" /><%
        } else if (AuthoringUIMode.fromRequest(slingRequest) == AuthoringUIMode.CLASSIC) {
            %><cq:includeClientLib categories="cq.wcm.edit" />
...

Take a look at the Geometrix pages and follow the JSPs they include. They will take you to other JSPs, and somewhere along the chain you will see where the foundation JSPs pull in client libraries depending on the WCM mode.

Also check out this link in your AEM instance to understand how client library dependencies can cause other client libraries to be included when a library with a dependency is included in your page: /libs/granite/ui/content/dumplibs.html

Upvotes: 2

Related Questions