Sunday, April 16, 2017

AEM 6 Advanced Interview Questions Part 2

AEM 6 Advanced Interview Questions Part 2


1. What is the role of persistence manager, data store, journal and indexes?
A: Persistence manager is used for storing the data in the repository. By Default AEM uses Tar persistence manager, which uses Linux's standard type of archive files - Tar. 
A data store is used for storing large contents. When the data is too big, it is not directly stored in persistence manger's storage but instead stored in data store and only the reference to this data is stored in persistence manager.
Journal helps in maintaining the data consistency and helps in system recovery from crashes. This also helps in synchronizing the cluster data.
Indexes are used for fast lookups of data for search and other function.

2. How to implement etc/mapping?
A : Inside /etc create a sling:Folder with the name map
Inside this folder create a sling:Folder with the name http
Inside this folder define sling:mapping node with the properties sling:match and sling:internalRedirect. Here sling:match is the request that is to be matched with respect to the actual website and sling:internalRedirect suggests the sling where the request should be redirected in AEM (say inside /content) or sling:redirect that suggests the sling where the request should be redirected outside the AEM.
These properties use regex to match with the url paths.

3. Explain design_dialog.
A : A design_dialog is used for the configuration of components on design level i.e. the site level. A design_dialog can be defined as cq:dialog just under the component node and can be accessed in design mode. A design dialog can have similar configurations as a dialog.

4. What is personalization?
A : Personalization provides the users with contents tailor made for them. There are three main components of it.
  • Users 
  • Content
  • Personalization rules
AEM provides a built in targeting engine that presents the personalized contents to the users.

5. How would you pass parameters to sling model from Sightly?
A: Following is the example how this can be done.

in Sightly template

<div data-sly-use.model3="${'org.example.models.Model3' @ colour='red', path=resource.path}">
${model3.shine}
</div>

In sling model class

@Inject
private String colour;

@Inject
private String path;


6. How would you design a global header and footer? Can you explain the same with the example of SDI?

7. How to configure WebDav and advantage of it?
A : You can configure WebDav using this link - 

The advantages of using WebDav is that the drive folder structure is mapped to AEM and you can upload larger DAM assets easily.

8. Why sling models are preferred on WCM Use API?
A : Following are the advantages of using sling models.
  • Easy to inject parameters
  • Easy to extend from other sling models
  • Simple set up for unit testing.
9. How do you transfer group permissions from one environment to another?

10. Purpose of servlet engine? Explain the same with respect to AEM 6.
A : Prior to AEM 6 the CQ5 used CQSE which is CQ Servlet engine. Which is replaced by Eclipse Jetty in AEM 6 version.
A servlet engine is used for handling servlet life cycle. Jetty can be configured in configMgr at org.apache.felix.http. AEM can also run on other application servers. For which you have to create a war file. You can configure the run mode of the war file in web.xml file.You can deploy publish and author instances both on the same application server.

11. Explain policy=ConfigurationPolicy.REQUIRE in @component.
A: ConfigurationPolicy defines the component's configuration policy. There are three values - OPTIONAL, REQUIRE and IGNORE. Here, REQUIRE means the configuration should be available in config node that is used for configuring run mode configuration.

12. What is ACL and ACEs?
A: ACL is access control list. It is implementation of AbstractAccessControlList which implements JCR's JackrabbitAccessControlList.The default implementation is nodeACL and principalACL.

ACE is access control entry. Which is implementation of AbstractAccessControlEntry. It contains restrictions and principals.

An ACE can be defined for a page in crxde lite environment under local access control policy. There are three types of access control policies here. Applicable access control policy, local access control policy and effective access control policy which can be of the current node or inherited from the parent.

There are priviledges like jcr:read, jcr:write, jcr:all,jcr: replicate,jcr:readAccessControl, jcr:modifyAccessControl, jcr:addChildNodes etc. And these priviledges are granted to the user/groups.

13. How to enforce UPDATE startup mode in AEM?
A: There are following ways of doing it.
  • By changing the jar file with higher version and starting the instance. This will start the UPDATE startup mode.
  • While starting the instance using java argument -Dorg.apache.sling.launchpad.startupmode=update

14. What is the difference between Tar Persistence manager and RDMS persistence manager?
A :
  • Tar PM is designed specifically for JCR repository.
  • Tar files are easy to backup.
  • Tar is platform independent format.
  • It can be accessed via standard zip tools like winzip.
  • It is based on key-value pair structure.
15. What is ACS? name and explain some of the features provided by it.
A: ACS is a bootstrap project with common AEM functionality and a set of components and AEM development toolkit.

  • It provides Dispatcher Flusher UI which can be used for flushing the cache manually.
  • Provides commons utils like CookieUtils, PathInfoUtil, OsgiUtil etc.
  • Also provide convenient way of exporting users in csv files.
16. How to implement a servlet in AEM?
A : A sling servlet can be registered as Sling service using @SlingServlet annotation. Which has properties like resourceType, name, description, selectors, extensions, methods. A servlet can have either resourceType of path. The path has to be starting with /bin which restricts the servlet to be used in publish instance. The servlet extends SlingSafeMethodsServlet or SlingAllMethodServlet however, it is not mendatory. SlingAllMethodServlet should be preferred when the data modification is intended.
This servlet can be called using jquery on the dialog box in order to retrive appropriate values in the dialog box and also can be used for inserting data input from forms.

17. Maven plugin for build AEM project.
A: maven-bundle-plugin

18. How is sling model mapped to sighlty page?
A : The java class that is declared as sling model should have the annotation @model with the value of adaptables which can be anything like resource or request.
This model class then can be initialized in the sightly page using <div data-sly-use.name="packagepath.class">... </div>

19. List down sling model annotations.
A :

  • Model 
  • Inject
  • Optional
  • Default
  • Named
  • Via
  • Source
  • PostConstruct
  • Self
  • SlingObject
  • ResourcePath
  • OsgiService
  • ValuesMapValue
  • RequestAttribute
20. What is script-bindings?
A : Script binding is the object which has all the variables and their values that is used for execution of the script.

21. Explain sightly templates.
A : Sightly templates are the functions or reusable html code that can be called with different values of parameters.
e.g.

 Non-parameterized template

<div data-sly-template.one>
some html code
</div>

<div data-sly-call="${one}">

Parameterized template

<div data-sly-template.paramTemp={@ a, b, c}>
 <a href="a" alt="b">c </a>
</div>

<div data-sly-call={paramTemp @  a="test.com", b="test", c="click here"}>
</div>

22.How to find maven dependency?
A: http://<host>:<port>/system/console/depfinder

23. How to see sling etc mappings?
A:http://<host>:<port>/system/console/jcrresolver

24. How to access sling model class in JSP?
<c:set var="class" value="<%=resource.adaptTo(class.class)%>">
or
<sling:adaptTo var="class" adaptable="${resource}"adaptTo="packagepath.class" >





No comments:

Post a Comment

Some more AEM 6 Interview Questions for Architects

 Some more AEM 6 Interview Questions for Architects 1. Consider you have a workflow with two steps. One step is to transfer the asset from s...