We have preparing some Adobe AEM CQ5 Interview Questions and Answers for freshers and experienced.
Adobe CQ5 (also known as Adobe Experience Manager) is a java based content management system from adobe. Following are the life cycle states of OSGI: Installed – The bundle has been successfully installed. Resolved – All Java classes that the bundle needs are available. This state indicates that the bundle is either ready to be started or has stopped. Starting – The bundle is being started, the BundleActivator.start method will be called, and this method has not yet returned. When the bundle has an activation policy, the bundle will remain in the STARTING state until the bundle is activated according to its activation policy. Active – The bundle has been successfully activated and is running; its Bundle Activator start method has been called and returned. Stopping – The bundle is being stopped. The BundleActivator.stop method has been called but the stop method has not yet returned. Uninstalled – The bundle has been uninstalled. It cannot move into another state. Adobe CQ5 uses the following technologies: Now a day’s websites are very dynamic in nature, content needs to be updated very frequently, so, it is easier to manage the content of such websites using a CMS. Below are the advantages of CQ5 over other CMS A CQ template enables you to define a consistent style for the pages in your application. A template comprises of nodes that specify the page structure. Components are re-usable modules that implement specific application logic to render the content of your web site. You can think of a component as a collection of scripts (for example, JSPs, Java servlets, and so on). The global.jsp script which adobe provides by default declares Sling, AEM and JSTL taglibs to make component creation easy in AEM. init.jsp should be included in our jsp or script file to display sidekick. A cq: EditConfig node is used to define the behavior of the component Basic SCR Annotation used for developing a component or service in osgi are:- Both dialog and design dialog are used by the user to configure the component. Design Dialog: of a component can be seen/edited in design mode of the page. Design dialog is present at template level so all the page of the template will share same design dialog. Dialog: of a component is present at page level so each component instance will have its own dialog and information entered in dialog will be stored under content folder. Design dialog data is stored under /etc./designs folder. Dialog data is stored under /content folder. Adaptive forms, is used to break down a form into logical sections, basically it enables end users to focus on filling out the form. When we require to take input from user we use Adaptive Form. New Updated AEM Interview Questions and Answers for 2023. Adaptive Document is used to display output to the end user. For example- a bank statement is an adaptive document as all its content remain same only name and amount changes. Basically, we put place holder text in Adaptive Document which are filled dynamically at run time. A site is basically a website, where we can place an Adaptive Form, Adaptive Document or a static text. To put multiple files, we can use many tools that supports WebDAV Protocol Like Net Drive. The different interfaces available in CRX are: You can resolve using Resource Resolver which you can get from method getResourceResolver() and then use resolve() method to resolve a resource. You can adapt a resource to any another type using adaptTo() method, which accepts class type in which you want to adapt your resource. i.e. Page page = resource.adaptTo(Page.class); It is used for adding site specific js and css files to the page and also third-party js and css files. jcr:primaryType of clientlibs folder is cq:ClientLibraryFolder. It takes cares of dependency management, merging files and minification of all js and css files stored under it. To connect to external DB, we need to configure a connection pool by creating a node of type sling:OsgiConfig. Please have a look at below screenshot for connecting to hsqldatabase, but if you want to connect to other DB then properties values needs to be changed accordingly. In CQ5 Dispatcher has two main roles: Caching – It is used to cache as much content as possible in the form of a static website which helps to reduce the continuous functioning of layout engine frequently for generating content when website data is dynamic. Load-balancing – To increase the performance by load-balancing. The Dispatcher uses a Cache Directory for caching static content. The cached documents are created in the root of a web-server. Dispatcher uses the following methods for caching: Content Updates invalidates those pages whose content has been updated and replaces it with new content. Auto-invalidation automatically invalidates the content parts which are out of date – without physically deleting any files. Performance Statistics – Dispatcher keeps statistics on how fast each instance of cq is responding to a particular url. Based on those metrics, dispatcher determines which instance of cq will fetch the quickest response for any request and relays the request to that cq instance. Sticky Connections – when a user session is established, then all incoming requests from that user should be served by the same cq instance, because other cq instances cannot recognize the user session and generate personalized pages for him. Dispatcher makes sure all requests for user session are served from the same cq instance. Increased fail-safe coverage – If the Dispatcher does not receive responses from an instance, it will automatically relay requests to one of the other instance(s) Increased processing power – In practice this means that the Dispatcher shares document requests between several instances of CQ. Because each instance has fewer documents to process, you have faster response times. Yes. In such cases, ensure that both the Dispatchers can access the CQ website directly. A Dispatcher cannot handle requests coming from another Dispatcher. Package: A Package is a zip file that contains the content in the form of a file-system serialization (called “vault” serialization) that displays the content from the repository as an easy-to-use-and-edit representation of files and folders. Packages can include content and project-related data. Bundle: Bundle is a tightly coupled, dynamically loadable collection of classes, jars, and configuration files that explicitly declare their external dependencies (if any). OSGi is a framework which allows modular development of applications using java. A large application can be constructed using small reusable components (called bundles in terms of OSGi) each of which can be independently started, stopped, and also can be configured dynamically while running without requiring a restart. Advantages of using OSGI are stated below: OSGi bundles are jar files with metadata inside. Much of this metadata is in the jar’s manifest, found at META-INF/MANIFEST.MF. This metadata, when read by an OSGi runtime container, is what gives the bundle its power. With OSGi, just because a class is public doesn’t mean you can get to it. All bundles include an export list of package names, and if a package isn’t in the export list, it doesn’t exist to the outside world. This allows developers to build an extensive internal class hierarchy and minimize the surface area of the bundle’s API without abusing the notion of package-private visibility. A common pattern, for instance, is to put interfaces in one package and implementations in another, and only export the interface package. All OSGi bundles are given a version number, so it’s possible for an application to simultaneously access different versions of the same bundle (eg: junit 3.8.1 and junit 4.0.). Since each bundle has it’s own class-loader, both bundles classes can coexist in the same JVM. OSGi bundles declare which other bundles they depend upon. This allows them to ensure that any dependencies are met before the bundle is resolved. Only resolved bundles can be activated. Because bundles have versions, versioning can be included in the dependency specification, so one bundle can depend on version junit version 3.8.1 and another bundle depend on junit version 4.0. In OSGi bundle, there will be an Activator.java class in OSGi which is an optional listener class to be notified of bundle start and stop events. parsys – It is a placeholder called “Paragraph System”, where we can drag and drop or add other components or scripts at page level. iparsys – It is inherited paragraph system, it is similar to parsys except that it allows to inherits parent page “paragraph system”. Sightly is an HTML templating language that was introduced in AEM 6.0. It is meant to take the place of JSP files and is the preferred templating system for HTML. The name sightly means “pleasing to the eye”, and its focus is to keep your markup beautiful and maintainable. Representational State Transfer (REST) is an architectural style and an approach to communications that is often used in the development of web services. It relies on a stateless, client server, cacheable communications protocol. RESTful applications use HTTP requests to post data, read data, and delete data.The six architectural constraints of REST are: uniform interface, stateless, cacheable, client server, layered system, and code on demand. Extending a component is when you want to create a new component that will not override a base component, but will have the same features as the original so that you can change or build upon that component. In order to extend a component, you must set“sling:resourceSuperType” of the component to the base component you would like to extend. By doing this, you will inherit everything from the base component. Resource mapping is used to define redirects, vanity URLs and virtual hosts for AEM. You can use resource mapping to prefix all requests with “/content” so the internal structure of the AEM site is hidden from your visitors. You can also use resource mapping to define a redirect so that all requests to the gateway page of your site are redirected to another site. Since AEM is built using OSGI, many of the design patterns for OSGI are valid. Some of these design patterns are Singleton (Service), Adapter Service, Resource Adapter Service, and Whiteboard. Also, since AEM is modular, you should be able to use any design pattern in your application. Reverse replication is the process of replicating content from publish environment to the author environment. In order to accomplish this, you need a reverse replication agent on your author instance that is configured to get content from the publish environment outbox.Explain Adobe CQ5?
Explain life cycle of OSGI bundle?
What is the technology stack used in cq5 or AEM?
Why a content management system is required in CQ?
What are the advantages of CQ5 over other CMS?
What is a Template?
What is a Component?
Why we need to include global.jsp if we are creating a component in jsp?
Which script you should include to display sidekick?
What is the use of EditConfig node in creating a component?
What are the basic SCR Annotations used for creating an OSGI component?
Difference between Dialog and Design Dialog?
Where dialog and design dialogue data is stored?
What is Adaptive Form? Explain Adaptive Form? What do you mean by Adaptive Form?
What is Adaptive Document? Explain Adaptive Document? What do you mean by Adaptive Document?
What do you mean by Site Page?
How to put multiple files in CRX repository?
What are the different interfaces available in AEM?
How do you resolve a resource?
How do you adapt a resource?
What is the purpose of clientlibs?
How to connect to external Database in CQ?
Explain the role of Dispatcher in CQ5?
Where does the cache directory exists for CQ5?
Explain the methods of Caching adopted by Dispatcher?
How Dispatcher performs Load-balancing?
Can I implement multiple Dispatchers in a setup?
What are the differences between package and bundle?
Explain life cycle of OSGI -Open Systems Gateway initiative bundle?
What are the advantages of using OSGI?
What are the difference between OSGi bundle and Normal Jar file?
What are the differences between parsys and iparsys?
What is sightly?
What is RESTful?
What is extending a component?
What is resource mapping?
What design patterns are used in AEM?
What is Reverse Replication?