On package install content that is already present in the repos must not be overwritten and if not present in the repos it must not be removed.
Which import mode should the developer use?
Answer : A
When installing a package in AEM and you want to ensure that existing content in the repository is not overwritten while ensuring that content not present in the repository is not removed, you should use the update import mode.
The update import mode performs the following actions:
It updates existing content nodes in the repository with the nodes from the package being installed.
It does not remove any existing nodes or properties in the repository that are not present in the package.
It adds any new nodes or properties from the package to the repository.
This mode is particularly useful when you want to preserve any manual changes or additions that might have been made to the repository content outside of the package installations.
Here's how you can specify the import mode during package installation:
Access Package Manager: Log into your AEM instance and navigate to the CRX Package Manager (e.g., http://localhost:4502/crx/packmgr/index.jsp).
Upload the Package: If the package is not already uploaded, click on 'Upload Package' and select the package file from your local system.
Install the Package: Click on 'Install' for the package you wish to install.
Choose the Import Mode: During the installation process, you will have the option to choose the import mode. Select update from the available options.
Complete Installation: Proceed with the installation. The content will be updated according to the rules defined by the update import mode.
By using the update mode, you ensure that your repository content is updated without losing any existing nodes or properties that are not part of the package.
Adobe Experience Manager Package Manager Documentation
AEM Import Modes
These steps ensure that you manage content updates in a controlled manner, preserving existing repository content while incorporating updates from the installed package.
Which query parameter needs to be added and set to true to debug a CQ HTML client library in the AEM author instance?
Answer : A
To debug a CQ HTML client library in the AEM author instance, you need to add the query parameter debugClientLibs set to true. This parameter instructs AEM to include additional debugging information for client libraries, making it easier to troubleshoot issues with JavaScript, CSS, and other assets.
Steps to enable client library debugging:
Open the AEM Page: Navigate to the AEM page where you want to debug the client libraries.
Append the Query Parameter: Add ?debugClientLibs=true to the URL. For example:
http://localhost:4502/content/we-retail/us/en.html?debugClientLibs=true
Reload the Page: Refresh the browser page. AEM will now include debugging information for client libraries.
This parameter helps in identifying issues with client library loading, dependencies, and other client-side resources.
Debugging Client Libraries in AEM
A developer needs to create a new Title component. The requirements are:
1. The layout must be the same as the Title core component
2. The text property must have the page title as prefix (e.g., Page Title -
3. The component must be reusable
Which approach is recommended?
Answer : A
A proxy component is a site-specific component that inherits from a core component and allows customization of the component name, group, dialog, and behavior. A proxy component can refer to any version of the core component by changing the sling:resourceSuperType property. A custom sling model can be used to implement the logic for adding the page title as prefix to the text property. A component template can be used to define the layout of the component.
A client has asked to share an HTML version of test coverage report for the AEM project.
What plugin should the AEM developer use to generate test coverage report using latest archetype?
A)

B)

C)

Answer : A
To generate a test coverage report for an AEM project using the latest archetype, the correct plugin to use is the maven-surefire-plugin (Option A). The maven-surefire-plugin is a part of the Maven ecosystem and is widely used to run unit tests within a Maven project. This plugin can be configured to generate detailed test reports, including HTML versions, which can be easily shared with clients.
Here's how to configure the maven-surefire-plugin to generate test coverage reports:
Add the Plugin to the POM File: Add the maven-surefire-plugin configuration in your pom.xml file:
<groupId>org.apache.maven.plugins</groupId>
<version>2.22.2</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<reportFormat>html</reportFormat>
<trimStackTrace>false</trimStackTrace>
</configuration>
Execute the Maven Command: Run the following command to execute the tests and generate the coverage report:
mvn clean test
Locate the Report: The HTML test coverage report will be generated in the target/surefire-reports directory of your project.
Maven Surefire Plugin Documentation
A developer is working on a project based on core components. The client requests that text pasted inside the Text component should be stripped of all styling and formatting.
The developer needs to override RTE plugin implementation and change the default paste (CTRL+V) behavior.
Which paste option should the developer add to achieve this?
Answer : B
To ensure that text pasted inside the Text component in AEM is stripped of all styling and formatting, you need to override the RTE (Rich Text Editor) plugin implementation and change the default paste behavior. The correct option to achieve this is defaultPasteMode=plaintext.
Steps to configure the RTE plugin for plain text pasting:
Locate the RTE Configuration: Find the existing configuration for the RTE or create a new one in the /apps directory of your AEM project.
Modify the Plugin Configuration: Add or update the configuration to include the defaultPasteMode parameter. The configuration might look something like this:
{
'jcr:primaryType': 'nt:unstructured',
'features': '[text]',
'defaultPasteMode': 'plaintext'
}
Apply the Configuration: Ensure that this configuration is applied to the Text component. This typically involves updating the component dialog or design dialog to reference the updated RTE configuration.
Test the Configuration: In the AEM author instance, open the page with the Text component and paste text using CTRL+V. The pasted text should now be stripped of all styling and formatting, adhering to the plaintext mode.
By setting defaultPasteMode to plaintext, you ensure that the RTE only accepts plain text input, removing any formatting that might come from external sources.
AEM Rich Text Editor (RTE) Documentation
Configuring the Rich Text Editor in AEM
Which type of Cloud Manager tests are enabled for all Cloud Manager production pipelines and cannot be skipped?
Answer : A
Code Quality Testing is a type of Cloud Manager tests that are enabled for all Cloud Manager production pipelines and cannot be skipped. Code Quality Testing checks the code quality of the project using SonarQube and reports any issues or vulnerabilities. Code Quality Testing can fail the pipeline if the code quality does not meet the minimum standards defined by Adobe. Reference: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/testing/testing-overview.html?lang=en#testing-types https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/testing/code-quality-testing.html?lang=en
A new component called Page Headline needs to be implemented. The only difference to the title component delivered by Adobe's WCM core components is that the text needs to be taken from the current page title instead of jcr.title.
How should a developer implement this request?
A)
1. Create custom component
2. Implement Sling Modal as follows

B)
1. Create proxy component from the core title component
2. Implement sling Model as follows

C)

1. Create proxy component from the core title component
2. Implement Sling Model as follows

Answer : C
To implement a new component called 'Page Headline' which takes the text from the current page title instead of jcr:title, you should create a proxy component from the core title component and implement a Sling Model accordingly. Option C demonstrates the correct approach to achieve this functionality.
Here is a detailed explanation of Option C:
Create Proxy Component:
Create a new component in your project that will act as a proxy to the core title component. This involves creating a new component node in the repository that inherits from the core title component.
Example path: /apps/myproject/components/pageHeadline with sling:resourceSuperType set to core/wcm/components/title/v2/title.
Implement Sling Model:
Implement a Sling Model that adapts from SlingHttpServletRequest and Title.class, ensuring it overrides the text fetching logic to retrieve the title from the current page's title.
The model will use @ScriptVariable to inject the current page and @Self to access the core title component's logic.
@Model(adaptables = SlingHttpServletRequest.class, adapters = Title.class, resourceType = 'myproject/components/pageHeadline')
public class PageHeadline implements Title {
@ScriptVariable
private Page currentPage;
@Self @Via(type = ResourceSuperType.class)
private Title title;
@Override
public String getText() {
return currentPage.getTitle();
}
@Override
public String getType() {
return title.getType();
}
}
@Model Annotation: Specifies that this class is a Sling Model and adapts from SlingHttpServletRequest. It is also an adapter for Title.class and applies to the myproject/components/pageHeadline resource type.
@ScriptVariable: Injects the current Page object, which allows access to the current page's properties.
@Self @Via(type = ResourceSuperType.class): Injects the core title component, allowing the reuse of existing logic.
getText() Method: Overrides the getText() method to return the title from the current page instead of the jcr:title.
getType() Method: Delegates to the core title component's getType() method to maintain existing functionality.
This approach leverages the power of Sling Models and the core components to extend functionality while keeping the implementation clean and maintainable.
Adobe Experience Manager - Core Components
Sling Models Documentation