Monday 29 April 2019

How to access session in the Sling Model

The session can be easily accessed in the sling model by using the Sling Object annotation. Below code helps us achieve it.

@SlingObject
private ResourceResolver resourceResolver

resourceResolver.adaptTo(Session.class)

Wednesday 17 April 2019

Where are the configurations stored in jcr

The configurations are stored at "/apps/system/config" path in JCR.

cq:Page Vs cq:PageContent

cq:Page is the jcr:primaryType of the page node, whereas
cq:PageContent is the jcr:primaryType for the jcr:content of template node where the information about the page is placed. In case of editable templates the initial content and the structure node's jcr:content is of cq:PageContent type. 

Tuesday 16 April 2019

Query builder | Performance Enhancement | p.guessTotal

In order to boost the performance of query builder, p.guessTotal parameter in the query builder URL can be very useful. This parameter stops the permission check for that session on each node of the result set.

Example::
http://localhost:4502/bin/querybuilder.json?path=/content&1_property=sling:resourceType&1_property.value=foundation/components/text&1_property.operation=like&p.guessTotal=50&orderby=path

extraClientlibs Usage

The purpose of property "extraClientlibs" is to selectively load client library for a dialog. This prevents the unnecessary load o...