Expand my Community achievements bar.

SOLVED

CQ version

Avatar

Level 1

Hi,

How can I programmatically access adobe cq version?

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Administrator
13 Replies

Avatar

Level 10

I am not sure whether is there any OOTB configuration.will check

But yes, this is something which does not change too often. May be once in a 2 year while you upgrade. You can store this any JCR node and access it.

Take a look @ adobeaemclub.com/how-to-find-out-aem-version-you-are-using/

Avatar

Level 1

       I got the solution for this.

       We can get product information from the node "/libs/cq/core/productinfo"

       Example:      def productInfo = request.resourceResolver.getResource("/libs/cq/core/productinfo")?.adaptTo(ValueMap) ?: [:]

        String version = productInfo["shortVersion"]

Avatar

Administrator

Hi

The product information is stored on the node "/libs/cq/core/productinfo" , you can read the information from those nodes.

For Reading JCR nodes, please have a look at any of these options:-

Link:- https://helpx.adobe.com/experience-manager/using/jqom.html

Link:- https://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html (Query Builder)

Link:- https://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html (JCR API)

 

[Jorg Hoh's Soultion]

Instead of relying the value in the JCR you can also query the ProductInfoService [1], which also provides you these information.

[1] https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/adobe/granite/license/ProductInfoServ...

 

 

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Employee Advisor

Instead of relying the value in the JCR you can also query the ProductInfoService [1], which also provides you these information.

kind regards,
Jörg

[1] https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/adobe/granite/license/ProductInfoServ...

Avatar

Administrator

Hi Jorg

This is awesome. This community is enriching all of us. 

Thanks for the information.This is added to my kitty now smiley.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 1

This doesn't work in recent AEM versions. Could you please help how to get product info in json format for AEM 6.3/4

Avatar

Correct answer by
Administrator

Avatar

Level 1

Hi kautuksahni​,

I had already found both of them. But the problem is:

In status-productinfo, it is not a perfect json and still need to be parsed a little to get product version.

And in second method, I need to create a servlet first as I want to get product info on client side.

Also, can you tell me where is the info saved now, like earlier there used to be a node in /libs/cq but now I can't find any node.

Avatar

Community Advisor

Hi,

If you need to expose info at client side, then you can do it with java API com.adobe.granite.license.ProductInfo which is suggested by Kautuk to get info and assign to javascript variable, so it can be accessible at client side.

If you are planning to do via reading node using JCR API, then also you won't be able to expose at client side until it is not exposed as javascript variable.

So go ahead and use JAVA API dedicated to access product info and expose value as javascript variable.



Arun Patidar

Avatar

Employee Advisor

Even if this information is available at some location in the JCR, it is not advised to use read from there. The official API is the ProductInfo, and any other way to to determine the product version might just works by incidence.

Jörg

Avatar

Level 2

There is a ReST endpoint at /libs/granite/operations/content/systemoverview/export.json. This is used from the operations dashboard. It exposes the product info as well.

Avatar

Level 4

For AEM 6.5 - programatically we can get the aem product version using below:

 

com.adobe.granite.license.ProductInfoProvider; 
com.adobe.granite.license.ProductInfo;
@OSGiService
private ProductInfoProvider productInfoProvider;
ProductInfo productInfo = productInfoProvider.getProductInfo(); 
productInfo.getVerion().toString(); //6.5.13.0
productInfo.getShortVersion(); //6.5