AEM Sites Developer - Certified Expert AD0-E116 Flashcards

1
Q

A custom lucene index that you set up isn’t being used for queries as epxected. What is the index config missing?

A. includedPaths property
B. queryPaths property

A

B.
queryPaths

“Path restrictions of queries are only checked against queryPaths”

https://jackrabbit.apache.org/oak/docs/query/lucene.html#include-exclude

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the downsides of an in place upgrade?

A. Lose content audit history
B. Takes time/Downtime
C. Risk of data loss because it’s not a copy of the environment
D. Complexity
E. Limited ability to roll back

A

B, C, D, E

Most of these are right: https://experienceleague.adobe.com/docs/experience-manager-65/deploying/upgrading/in-place-upgrade.html?lang=en . In-place upgrade is where you run the upgrade on an existing instance. It’s cost-effective if you’re paying per-instance, but the downsides are you have to take your current instance down while the upgrade is in progress, and you won’t have time to test the new version side-by-side with the old.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If you want an a sub-component that can be added as a child of the Embed component, what sling:resourceSuperType and component group should your component have?

A

resourceSupertype should be core/wcm/components/embed/v1/embed/embeddable, componentGroup is .hidden

The real exam question will list code samples of the component

https://github.com/adobe/aem-core-wcm-components/blob/main/content/src/content/jcr_root/apps/core/wcm/components/embed/v1/embed/embeddable/.content.xml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the default import mode for A/C Handling?

A. Merge
B. Ignore
C. Overwrite
D. Replace

A

B.
Default AC handling mode is ignore

https://experienceleague.adobe.com/docs/experience-manager-65/administering/contentmanagement/package-manager.html?lang=en#advanced-settings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you limit the number of concurrent workflow jobs (for bulk image upload, for example)

A

Configure Queue: Granite Workflow Queue
or
Configure the queue can from the Sling Jobs option of the AEM Web console; for Job Queue Configuration: Granite Workflow Queue, at http://localhost:4502/system/console/slingevent.

https://experienceleague.adobe.com/docs/experience-manager-64/developing/extending-aem/extending-workflows/workflows-best-practices.html?lang=en

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What Omni channel features in AEM cloud CANNOT help serve assets to a mobile app or SPA from a headless instance?

A. Graph QL
B. Content services
C. Sling models for Content fragments and experience fragments
D. Assets HTTP API
E. Adobe I/O

A

C.
Sling Models don’t exist for Experience Fragments.

Assets API enables CRUD operations; good for managing assets. Graph QL is great for serving up Content Fragments or creating compiling data from CFs and pages. Content Services are authorable, and can serve up Experience Fragments or pages. Assets API can serve up images and CFs, can also be used to manage content. Adobe I/O Runtime can export published content from AEM as JSON and push it to other external cloud services.
https://blog.developer.adobe.com/headless-commerce-content-management-with-aem-i-o-runtime-87c315283b74

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the best way to implement an event-driven data layer?

A

Adobe Client Data Layer

https://experienceleague.adobe.com/docs/experience-manager-learn/sites/integrations/adobe-client-data-layer/data-layer-overview.html?lang=en

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Best way to share read only assets between instances?

A. Asset Link Share
B. Connected assets.

A

Connected Assets

Connected Assets https://experienceleague.adobe.com/docs/experience-manager-65/assets/using/use-assets-across-connected-assets-instances.html?lang=en.
Asset Link is used to integrate AEM Creative Cloud (Photoshop, Illustrator, etc) with AEM Assets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A custom AEM application contains Bundle A and Bundle B. Bundle A has a dependency to Bundle B via Import-Package.
How can both bundles be deployed most efficiently across all environments?

A. Use the Felix Web Console to upload the bundles in the correct order.
B. Create one content package per bundle and use a package dependency to ensure installation order.
C. Embed both bundles in one content package and use property ‘installationOrder’ in package
properties for correct bundle installation order.
D. Embed both bundles in one content package: the dependency via Import-Package is enough to
ensure correct installation.

A

D

OSGI will ensure dependency order while bundles are in Resolved state

If BundleA requires classes from BundleB and OtherBundle, adding Import-Package and Export-Package metadata in the MANIFEST.MF of all bundles should be sufficient.

BundleA MANIFEST.MF
Import-Package: my.required.package.from.b, other.package.in.b, other.package

BundleB MANIFEST.MF
Export-Package: my.required.package.from.b, other.package.in.b

OtherBundle MANIFEST.MF
Export-Package: other.package

https://stackoverflow.com/a/35181295

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where do context-aware configs live?

A

Context-Aware configs are located at:
/conf/<my-site>/sling:configs/<my-configuration>

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/context-aware-configs.html?lang=en
Your site may need different configurations for different sites regions for instance where some parameters may be shared requiring inheritance for nested contexts and global fallback values. AEM leverages Sling context aware configurations, which enable this possibility.
“The application needs different configuration for different sites, regions and tenants = different contexts.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

After an in-place upgrade, the acs commons bundle isn’t starting. What is the cause?

A

Uninstall the package and add ACS Commons and a maven depencency

NEED CONFIRMATION on question, but I think this is the correct answer

https://adobe-consulting-services.github.io/acs-aem-commons/pages/maven.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How is the Pattern Detection Tool used for in-place upgrades?

A

The pattern detection tool can be used to determine the complexity of an upgrade.

This feature allows you to check existing AEM instances for their upgradability by detecting patterns in use that:

Violate certain rules and are done in areas that will be affected or overwritten by the upgrade
Use an AEM 6.x feature or an API that is not backwards compatible on AEM 6.4 and can potentially break after upgrade.
This could serve as an assessment of the development effort that is involved in upgrading to AEM 6.4.
https://experienceleague.adobe.com/docs/experience-manager-64/deploying/upgrading/pattern-detector.html?lang=en

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A developer wants to change the log level for a custom API.
Which OSGi configuration should the developer modify?

A. Apache Sling Logging Configuration
B. Apache Sling Log Tracker Service
C. ApacheSling Logging Writer Configuration
D. Adobe Granite Log Analysis Service

A

A.
Apache Sling Logging Configuration

https://experienceleague.adobe.com/docs/experience-manager-65/deploying/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A custom AEM application is using the PageManager API. What should a developer add to make the application compile and run correctly in AEM?

A. a maven dependency to AEM uber-jar to the content package
B. a maven dependency to bundle cq-wcm-core to the application bundle
C. a maven dependency to AEM uber-jar to the application bundle
D. a maven dependency to bundle cq-wcm-api to the content package

A

C.
Add a maven dependency to AEM uber-jar to the application bundle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Refer to thefollowing four Client Library Folders
One
- categories="[library.one]"
- dependencies="[library.three, library.four]"
- embed="[library.two]"

Two
- categories="[library.two]"
Three
- categories="[library.three]"
- dependencie="[library.four]"
Four
- categories="[library.four]"

A developer uses the following:
html
<data-sly-call="${clientlib.css @ categories='library.one'}" />

What is the resulting HTML?
A. <link rel="stylesheet" href="library.two.css" >
<link rel="stylesheet" href="library.three.css" >
<link rel="stylesheet" href="library.four.css" >
B. <link rel="stylesheet" href="library.two.css" >
<link rel="stylesheet" href="library.one.css" >
<link rel="stylesheet" href="library.three.css" >
C. <link rel="stylesheet" href="library.four.css" >
<link rel="stylesheet" href="library.three.css" >
<link rel="stylesheet" href="library.one.css" >
D. <link rel="stylesheet" href="library.three.css" >
<link rel="stylesheet" href="library.four.css" >
<link rel="stylesheet" href="library.one.css" >

A

C.
<link rel="stylesheet" href="library.four.css" >
<link rel="stylesheet" href="library.three.css" >
<link rel="stylesheet" href="library.one.css" >

This has been tested and confirmed on a local instance.

The dependencies will render first, then the main clientlib. Embedded clientlibs are compiled into the rendered css/scripts and aren’t rendered as separate link elements. Clientlib One lists library.three as a dependency first, but because library.four is a dependency of library.three, it is rendered first.
https://experienceleague.adobe.com/docs/experience-manager-65/developing/introduction/clientlibs.html?lang=en

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

AEM is installed in $AEM_HOME.
In which subfolder are the command line startup and shutdown scripts located?

A. $AEM_HOME/

B. $AEM_HOME/crx-quickstart/scripts

C. $AEM_HOME/crx-quickstart/opt/

D. $AEM_HOME/crx-quickstart/bin/

A

D

Confirmed on local instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

A developer is working on the following Sling Model that is being used in a component.

@Model(adaptables = SlingHttpServletRequest.class, defaultInjectionStrategy =
DefaultInjectionStrategy.OPTIONAL)
public class SampleModel { 
    @Inject
    private Page currentPage; 
		private boolead matchingTitle; 
		
		@PostConstruct
    private void init(){
		 matchingTitle = title.equals(currentPage.getName());
    }
    public boolean isMatchingTitle(){
		 return matchingTitle;
    }
}

The model must check if the configured value of the jct:title property for the component matches the
same name of the current page. If the jcr:title property of the component has NOT been configured, then
isMatchingTitle() must return false.
How should the developer inject the title property in this model?

A. “@ValueMapValue @Via(““jcr:title””) @Required private String title;”
B. “@ValueMapValue @Named(““jcr:title””) @Default(values = “”””) private String title;”
C. “@ValueMapValue @Named(““jcr:title””) @Required private String title;”
D. “@ValueMapValue @Via(““jcr:title””) @Default(values = “”””) private String title;”

A

B.
@ValueMapValue @Named(""jcr:title"") @Default(values = """") private String title;

This question may be outdated.

The current way the annotations are written are as follows:
@ValueMapValue(name = "jcr:title", injectionStrategy = InjectionStrategy.OPTIONAL)
private String title
https://sling.apache.org/apidocs/sling8/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.html
https://sling.apache.org/documentation/bundles/models.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

A Client-Side Library has the category “library.example”.
Which HTL statement should a developer use to reference only the CSS files of this Client-Side library

A. <sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html" data-sly-call="${clientlib.css @ categories='library.example'}"/>

B. <sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html" data-sly-call="${clientlib.css @ category='library.example'}"/>

C. <sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html" data-sly-call="${clientlib.all @ type='css' categories='library.example'}"/>

D. <sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html" data-sly-call="${clientlib.all @ categories='library.example.css'}"/>

A

A.
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html" data-sly-call="${clientlib.css @ categories='library.example'}"/>

https://experienceleague.adobe.com/docs/experience-manager-htl/content/getting-started.html?lang=en#common-patterns-with-htl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A developer wants to consume AEM Page Data in Single Page Application. The Single Page Application is coded to understand JSON format. Only page content should be exposed through JSON. All the
existing components are based on foundation components.
Which change should the developer make in the existing components to support this requirement?

A. Add JSON as the default extension in Apache Sling Servlet Script Resolver and Error handler
Configuration
B. Implement a Sling Model Exporter for the components
C. Create a custom sling event handler to handle JSON requests
D. Invoke the page URL with the extension .json to get the values to construct the required output

A

B.

Render the page with the “.model” selector and the “.json” extension.
https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/understand-sling-model-exporter.html?lang=en

20
Q

A developer needs to implement a functionality that requires creating a Custom Workflow Step.
Which two steps should the developer take to start developing the custom behavior? (Choose two)

A. Implement a Java class extending from class com.adobe.granite.workflow.exec.WorkflowProcess
B. Create a Workflow component node of the Super Resource Type
“cq/workflow/components/model/process” under the folder /apps/[project]/workflow/components
C. Create a Workflow component node of the Super Resource Type “cq/workflow/components/step”
under the folder /etc/workflow/models
D. Implement a Java class with this method “public void process (WorkItem item, WorkflowSession
wfsession) throws WorkflowException”
E. Implement a Java class implementing the interface
com.adobe.granite.workflow.exec.WorkflowProcess

A

B & E

Tested locally

https://experienceleague.adobe.com/docs/experience-manager-64/developing/extending-aem/extending-workflows/workflows-customizing-extending.html?lang=en
Note, the above example is out of date and uses SCR annotations. Refer to https://www.argildx.us/technology/migration-of-scr-annotations-to-ds-annotations/ for DS annotations

21
Q

In which maven build phase is the content package assembled?

A. install
B. compile
C. package
D. deploy

A

C

https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

22
Q

A developer is creating a custom component that shows a list of pages. For each page, the following
items must be shown:

  • Title of the page
  • Description of the page
  • A button with fixed text “Read more” that must be translatable All of the above fields must bewrapped
    in a <div> tag.

The logic for obtaining the list of pages must be reusable for future components. Which
snippet should the developer use to meet these requirements?

A.

<sly data-sly-use.model="com.example.Component" />
<div data-sly-list="${model.pages}">
    <p>${item.title}</p>
    <p>${item.description}</p>
    <a href="${item.link}">${"Read more" @ .translate}</a>
</div>

B.

<sly data-sly-load.model="com.example.Component"/>
<div data-sly-list.pages="${model.pages}">
    <p>${page.title}</p>
    <p>${page.description}</p>
    <a href="${page.link}">${"Read more" @ i18n}</a>
</div>

C.

<sly data-sly-use.model="com.example.Component"/>
<div data-sly-list="${model.pages}">
    <p>${item.title}</p>
    <p>${item.description}</p>
    <a href="${item. link}">${"Read more" @ .i18n} <a>
</div>

D.

<sly data-sly-use.model="com.example.Component"/>
<div data-sly-list="${model.pages}">
    <p>${model.title}</p>
    <p>${model.description}</p>
<a href="${item. link}"> ${ "Read more" @ .translate} <a> </div>
A

B

https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md

23
Q

Too many pages are invalidated in the dispatcher cache when a page is published.
What is most likely causing this issue in the dispatcher configuration?

A. Sticky session are NOT configured properly, resulting in requests being delivered to the wrong server.
B. The level of cache invalidation is NOT appropriate for the published content model.
C. File globbing in the dispatcher configuration is NOT correct.
D. The OS file systempermissions are NOT properly configured

A

B

24
Q

A developer is working with the following HTL expression in a component rendering script:

${'path/page.infinity.json' @ extension = 'html',
 removeSelectors = ['foo'],
 selectors = ['foo', 'bar'],
 prependSuffix = 'hello',
 suffix = 'world' }

What is the expected output of this expression?

A. path/page.foo.bar.html/hello/world
B. path/page.infinity.json.bar.html/world
C. path/page.bar.html/hello/world
D. path/page.bar.html/world

A

C.
path/page.bar.html/hello/world

Tested locally

https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md
Breakdown:
extention - change the .json extension to .html
selectors - adds “foo” and “bar” selectors
removeSelectors - removes “foo” selector
suffix - adds “world” suffix
prependSuffix - prepends “hello” suffix before “world” suffix

25
Q

A developer is working on a project locally and needs to install packages manually. The deployments to
the localhost must be automated to speed up development. This functionality must be toggled on and off,
depending on the needs of the developer.
Which step should the developer take to achieve this?

A. Configure the maven install plugin by defining the target URL, username and password as maven
properties.
B. Add a maven profile and configure the content package maven plugin within this profile
C. Write a script that does a PUT call to AEM each time maven builds a new package
D. Run maven with the deploy phase. Maven will install the package on all local AEM instances running
without further configuration

A

B

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/developer-tools/maven-plugin.html?lang=en

26
Q

A developer needs an existing workflow to run only when pages are created under a certain folder.
What should the developer create to achieve this?

A. A Launcher with the field path pointing to the folder and condition field and have the value
jcr:content/jcr:primaryType==cq:Page
B. A Launcher with the field condition that has the value jcr:content/page
C. A Launcher with the field exclude that has the value jcr:nodeType==cq:Page
D. A Launcher with the field path pointing to the folder and nodetype field have the value cq:Page

A

D.

Tested locally

http://localhost:4502/mnt/overlay/cq/workflow/admin/console/content/launchers/createwizard.html

27
Q

A developer needs to create a component with the following requirements:
* The component must be configurable
* The component should be editable, NOT removable
* An author should be unable to add the component to a page through design mode

A.
~~~
+ component
- jcr:primaryType=”cq:Component”
- jcr:title=”Component”
- componentGroup=”.hidden”
+ cq:dialog

+ cq:editConfig
- cq:actions = “[edit]”
~~~

B.
~~~
+ component
- jcr:primaryType=”cq:Component”
- jcr:title=”Component”
- componentGroup=”.hidden”
- cq:actions = “[edit]”
+ cq:dialog

~~~

C.
~~~
+ component
- jcr:primaryType=”cq:Component”
- jcr:title=”Component”
- cq:actions = “[edit]”
+ cq:dialog

~~~

D.
~~~
+ component
- jcr:primaryType=”cq: Component”
- jcr:title=”Component”
- hidden=”true”
+ cq:dialog

+ cq:editConfig
- cq:actions = “[edit]”
~~~

Which mode structure should thedeveloper use to meet these requirements?
A. Option A
B. Option B
C. Option C
D. Option D

A

A

componentGroup=".hidden" prevents authors from adding the component, and cq:actions = "[edit]" is a property on the cq:editConfig node.

28
Q

A developer is creating a custom component on the page /latestBlogs.html that needs to list all the titles
of the blogs pages under /content/blogs.
How does this component get the list of child pages?

A. Instantiate a node object with session.getNode(/content/blogs) and then iterate through the child
nodes and print the title for each.
B. Use the QueryDebugger to look for all children of /content/blogs and then iterate through the result set
and print the title for each.
C. Adapt the resourceResolver to the PageManger service, then use the getPage(/content/blogs) to
instantiate a Page object andthen iterate through the child pages and print the title for each.
D. Use PageManager.getPage(“/content/blogs”) of the static PageManager class to instantiate a Page
object and then iterate through the child pages and print the title for each.

A

B.

29
Q

A developer needs to analyze log messages forcustom Java application. The developer writes the
following Java class:

package com.abc.xyz;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyClass {
 private static final Logger logger = LoggerFactory.getLogger(this.getClass());
 public void customMethod() {
  logger.debug("A custom log message");
 }
}

The developer creates a custom log named custom.log with a debug level in OSGi web console for Java
package com.abc.xyz.

Where should the developer look in the OSGi webconsole to view the above message?

A. OSGi -> Log Service and click logs/custom.log
B. Sling-> Log Support and click logs/custom.log
C. Sling -> Metrics and click logs/custom.log
D. AEM -> Log Support and click logs/custom.log

A

B

30
Q

A developer creates a custom Client Library named foobar.

This Client Library embeds 5 other Client Libraries and contains 10 JavaScript source files. One of these
files, called foo.js, has a bug on line 8 which causes an exception. The Client Library is throwing this
exception on line 1350 when it is included on a webpage.

How should a developer find the exact line in foo.js where the exception has been thrown?
A.
1. Enable JS/CSS minification in OSGi configuration console for HTML Library Manager.
2. Check the JavaScript exception log in the OSGi web console.
B.
1. Temporarily remove the embedded Client Libraries of the foobar Client Library.
2. Use the browser JavaScript debugging tools.
C.
1. Add the selector debugClientLibs to the page request.
2. Check the JavaScript exception log in the OSGi web console.
D.
1. Add the query parameter debugClientLibs=true to the request.
2. Use the browser JavaScript debugging tools.

A

D.

https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-16935.html?lang=en

31
Q

A developer needs to ensure that the path /content/segments exists on all environments with the correct initial content that the developer provides in a package. Content that exists in that path should NOT be
affected.

Which import mode should the developer use in the filter definition?

A. update
B. merge
C. replace
D. optional

A

B.

https://jackrabbit.apache.org/filevault/filter.html

32
Q

An application runs specific license checks against certain DAM assets every day. It should send an
email to a configured list if it finds warnings, and mark the asset accordingly. A service component that
uses the Apache Sling Scheduler Service is created. DAM assets that must NOT be used anymore are
hidden using ACLs and the license check must re-check them.

How should a developer obtain a resource resolver that can read and update the DAM assets?

A. Set up a cron job with curl calls with the admin user and use request.getResourse().getResourceResolver().
B. Create a configuration line in PID com.day.cq.security.ACLSetup for the user that you obtain a session for via ResourceResolverFactory.getResourceResolver(…).
C. Configure the user admin in PID org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl as user.default and make sure the service user exists and has jcr:read and jcr:write permissions.
D. Create a configuration for PID
org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-damaccess that references a pre-created service user with r/w permissions and use
ResourceResolverFactory.getServiceResourceResolver(…).

A

D.

https://experienceleague.adobe.com/docs/experience-manager-64/administering/security/security-service-users.html?lang=en
The config factory is called Apache Sling Service User Mapper Service Amendment

33
Q

Which maven plugin is required to install a content package on a local AEM environment using maven?

A. Maven Bundle Plugin
B. Content Package Maven Plugin
C. FileVault Package Maven Plugin
D. Maven Install Plugin

A

B.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/developer-tools/maven-plugin.html?lang=en

34
Q

After adding new features, a developer’s environment is experiencing slowness before ultimately running out of memory. The initial log analysis points towards a large number of open sessions.

Which action should the developer take to further monitor the overall session count on this AEM
instance?

A. Run the following command to generate thread dumps jstack -l&raquo_space; threaddumps.log, analyze thread
dumps to find long running sessions.
B. Go to Web Console > Status > Threads, verify the overall thread count.
C. Go to Tools > Operations > Monitoring. Create a new report based on Number of Active Sessions as
metric.
D. Go to /crx-qiuckstart/logs/strderr/log, use the following command grep -o 'CRXSessionImpl' strderr.log| wc -l.

A

D

https://helpx.adobe.com/experience-manager/kb/AnalyzeUnclosedSessions.html

35
Q

A developer creates a custom component. The component dialog includes the following two fields:

text
  - jcr:primaryType="nt:unstructed"
  - sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
  - fieldlabel="Text"
  - name="./text"

  charLimit
  - jcr:primaryType="nt:unstructed"
  - sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
  - defaultValue="0"
  - fieldlabel="Character Limit"
  - name="./charLimit"

The component should display the first ‘X’ characters of the text entered in the ‘text’ input where ‘X’ is the
number entered in the ‘charLimit’ input. If zero, or no value, is entered in the ‘charLimit’ input then the
text shouldbe unaltered. The developer creates the following Sling Model to perform the trancation:

java
@Model (adaptables = SlignHttpServletRequest.class, defaultInjectionStrategy DefaultInjectionStrategy.OPTIONAL) 
public class Truncation {

  @ValueMapValue
  private String text;
  
  @ValueMapValue
  private Integer charLimit;
  
  @PostMapValue
  private void init() {
    if (text != null && 0 < charLimit && charLimit < text.length()) {
      text = text.substring(0, charLimit);
    }
  }

  public String getText() {
    return text; 
  }
}

A Null Pointer Exception occurs if NO charLimit values is set in the component dialog.
What should the developer do to resolve this issue?

A. Replace the defaultValue=”0” attribute of the ‘charLimit’ field in the dialog with min=”0”.
B. Add the @Default annotation to the ‘chatLimit’ variable in the Sling Model.
C. Replace the defaultValue=”0” attribute of the charLimit field in the dialog with defaultValue=”{Long}0”.
D. Change the defaultInjectionStrategy of the Truncation Sling Model to DefaultInjectionStrategy.REQUIRED.

A

B

https://sling.apache.org/documentation/bundles/models.html#defaults
If no default is defined, the sling model property will be null

36
Q

A developer running a local AEM instance and working on an AEM project needs to change a
large number of files locally in filesystem. The developer needs to get the changes uploaded to the local
AEM instance to verify changes almost immediately in the browser.
What action should the developer take to most efficiently meet these requirements?

A. Build a Content Package using maven and deploy it after each change
B. Access CRXDE and upload the files through the interface
C. Make the changes in CRXDE, create a content package, download it and expand it into the working
directory after each change
D. Install FileVault bundle in the AEM instance and register the local working directory for
synchronization

A

D.

https://experienceleague.adobe.com/docs/experience-manager-65/developing/devtools/ht-vlttool.html?lang=en#setting-up-filevault-sync
FileVault sync will sync changes between the local file system and the AEM repository. Requires installation of an OSGI service.

37
Q

A developer is working on a dialog for a contact list component. The dialog has the following
requirements:

  1. The list of contacts must include one or more entries.
  2. Contact details must include a full name.
  3. Contact details must include an email address
  4. Contact details can optionally include a short bio
  5. Authors need to be able to rearrange the contacts in the list

Which dialog configuration should the developer use to meet all of these requirements?

A.

\+ multi
  - sling:resourceType="granite/ui/components/coral/foundation/form/multifield”
  - composite="{Boolean}true”
  - fieldLabel="Contact List”
  \+ field
    - sling:resourceType="granite/ui/components/coral/foundation/container”
    - name="./contacts”
    \+ items
      \+ name
        - sling:resourceType="granite/ui/components/coral/foundation/form/textfield”
        - fieldLabel="Full Name”
        - name="./name”
      \+ email
        - sling:resourceType="granite/ui/components/coral/foundation/form/textfield”
        - fieldLabel="Email Address”
        - name="./email”
      \+ bio
        - sling:resourceType="granite/ui/components/coral/foundation/form/textarea”
        - fieldLabel="Short Bio”
        - name="./bio”
        - required="{Boolean}false”

B.
~~~
+ multi
- sling:resourceType=”granite/ui/components/coral/foundation/form/multifield”
- composite=””{Boolean}true”
- fieldLabel=”Contact List”
- required=”{Boolean}true”
+ field
- sling:resourceType=”granite/ui/components/coral/foundation/container”
- name=”./contacts”
+ items
+ name
- sling:resourceType=”granite/ui/components/coral/foundation/form/textfield”
- fieldLabel=”Full Name”
- name=”./name”
- required=”{Boolean}true”
+ email
- sling:resourceType=”granite/ui/components/coral/foundation/form/textfield”
- fieldLabel=”Email Address”
- name=”./email”
- required=”{Boolean}true”
+ bio
- sling:resourceType=”granite/ui/components/coral/foundation/form/textarea”
- fieldLabel=”Short Bio”
- name=”./bio”
~~~

C.
~~~
+ multi
- sling:resourceType=”granite/ui/components/coral/foundation/form/multifield”
- fieldLabel=”Contact List”
- required=”{Boolean}true”
+ field
- sling:resourceType=”granite/ui/components/coral/foundation/container”
- composite=”{Boolean}true”
- name=”./contacts”
+ items
+ name
- sling:resourceType=”granite/ui/components/coral/foundation/form/textfield”
- fieldLabel=”Full Name”
- name=”./name”
- required=”{Boolean}true”
+ email
- sling:resourceType=”granite/ui/components/coral/foundation/form/textfield”
- fieldLabel=”Email Address”
- name=”./email”
- required=”{Boolean}true”
+ bio
- sling:resourceType=”granite/ui/components/coral/foundation/form/textarea”
- fieldLabel=”Short Bio”
- name=”./bio”
~~~

D.
~~~
+ multi
- sling:resourceType=”granite/ui/components/coral/foundation/form/multifield”
- fieldLabel=”Contact List”
+ field
- sling:resourceType=”granite/ui/components/coral/foundation/container”
- composite=”{Boolean}true”
- name=”./contacts”
+ items
+ name
- sling:resourceType=”granite/ui/components/coral/foundation/form/textfield”
- fieldLabel=”Full Name”
- name=”./name”
+ email
- sling:resourceType=”granite/ui/components/coral/foundation/form/textfield”
- fieldLabel=”Email Address”
- name=”./email”
+ bio
- sling:resourceType=”granite/ui/components/coral/foundation/form/textarea”
- fieldLabel=”Short Bio”
- name=”./bio”
- required=”” {Boolean} false”
~~~

A

B

https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/multifield/index.html
The Multi-field node gets the required property, and the required property. The first child (container) gets the name property.

38
Q

Which environment variable in the AEM start script should a developer modify to enable remote
debugging?

A. CQ_RUNMODE

B. CQ_JVM_OPTS

C. CQ_PORT

D. CQ_HOST

A

B

CQ_JVM_OPTS

https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-17459.html?lang=en

39
Q

After a recent code deployment, an AEM site is experiencing longer than usual query execution time.
The deployment package contained some new Lucene index definitions. A developer needs to identify
the long running queries and confirm that the new index definitions are getting applied correctly.
Which action should the developer take to investigate this problem?

A. Goto Tools > Operations > Diagnosis > Log Messages. Configure DEBUG log level on
com.day.cq.search tomonitor search queries.
B. Goto Tools > Operations > Diagnosis > Query Performance > Slow Queries. Select a Query and Click
on Explain
C. Goto Tools > Operations > Diagnosis > Index Manager. Select the new Indexes and run a
consistency check.
D. Goto Tools > Operations > Diagnosis > Download Thread Dumps. Analyze the Thread Dumps to
identify long running request

A

B.

This question is out of date for AEM as a Cloud Service.
https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/debugging/debugging-aem-as-a-cloud-service/developer-console.html?lang=en#queries
For AEMaaCS, the dev console, or visiting http://localhost:4502/libs/granite/operations/content/diagnosistools/queryPerformance.html will open the query performance screen.

40
Q

The following stack trace is written in the error.log file after installing a custom application package.
~~~
Could not start bundle com.adobe.cq.sample-bundle [526]. Reason: {}. Will retry.
org.osgi.framework.BundleException: Unable to resolve com.adobe.cq.sample-bundle 526: missing requirement [com.adobe.cq.sample-bundle] osgi.wiring.package
~~~

What are two different ways that the developer could resolve the OSGi bundle dependency error?
(Choose two)

A. Go to the Dependency Finder in the System Console to find if another bundle is exporting a similar version of the classes and change the project pom.xml to match the same version
B. Install the jar in AEM via the curl command 'curl -u username:password -F file=@"./com.example.customlib-3.8.jar" -F name="Dependency" -F force=true -F install=true http://localhost:4502/crx/packmgr/service.jsp --progress-bar -o upload.txt'
C. Create a folder named “deploy” under $AEM_HOME/crx-quickstart/ and copy com.example.customlib-3.8.jar in there so AEM uploads it automatically
D. Go to the project parent pom.xml file and add the dependency with the scope “compile” and instruct the bundle plugin to include the dependency in runtime
E. Upload the file com.example.customlib-3.8.jar into /apps//libs folder in CRX DE to make it available for the OSGi bundle

A

A. and D.

This one is more of a process of elimination.

B is wrong because you install crx packages with that curl command, but not OSGI bundles.
https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-17456.html?lang=en

C is wrong, because the folder you install bundles is “install”, not “deploy” and this is how you can install crx packages on startup
https://helpx.adobe.com/experience-manager/kb/HowToInstallPackagesUsingRepositoryInstall.html

E is wrong because you cannot upload files through crx/de. It’s possible to upload bundles through the system/console, or by packaging them up as crx packages and uploading them through /crx/packmgr

LASTLY, answers A and D are correct because we want to see if a different version of the bundle is available on the system, or through a maven repo and update the dependency. We want to avoid installing JARs or bundles directly and instead rely on Maven dependencies because we may not have access to install bundles on higher environments.

https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/set-up-a-local-aem-development-environment.html?lang=en#bundle-active

https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope

41
Q

Which log file contains AEM application request and response entries?
A. response.log
B. request.log
C. history.log
D. audit.log

A

B

Analyzing the logs on a local instance shows:
~~~
15/Feb/2023:14:46:59 -0500 [7996] -> GET /libs/granite/csrf/token.json HTTP/1.1
15/Feb/2023:14:46:59 -0500 [7996] <- 200 application/json 5ms
~~~

the -> arrow indicates a request entry, and the <- arrow indicates a response entry.

Note that logging has changed for AEMaaCS. https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/debugging/debugging-aem-as-a-cloud-service/logs.html?lang=en

42
Q

A custom AEMapplication has a run time dependency to a third party OSGi bundle that is NOT included
in out-of-the-box AEM. The third party dependency needs to be available for multiple applications and be
upgraded separately from the custom AEM application.

How should a developer make sure that the bundle is installed on all environments?

A. Add the dependency to the third party bundle in pom.xml of the project bundle
B. Embed the third party bundle in the bundle that depends on it
C. Embed the bundle in a content package to have it automatically deployed
D. Declare the dependency correctly using a link to the OSGi Bundle Repository (OBR)

A

A

B. is wrong because it risks duplicatd bundles and it unecessarily increases the size of the bundle
C. is wrong because we may not have access to the package installer on higher environments

43
Q

Which xml tag is used within the vault package definition to add a new path to a content package?

A. <filter>
B. <content>
C. <path>
D. <rule>

A

A

https://jackrabbit.apache.org/filevault/filter.html#Filter_Elements

44
Q

A developer creates a Sling Servlet. The Sling Servlet is bound to a path (/service/sling/sample). Refer to
the resulting code below.
~~~
@Component (immediate=true, service = {Servlet.class})
@SlingServletPaths(value = {“/service/sling/sample”})
~~~
What should the developer do to make the servlet access controlled using the default ACLs?

A. Add @SlingServletPrefix (value = “/apps”) annotation
B. Use @SlingServletResourceTypes instead of @SlingServletPaths
C. Modify @SlingServletPaths(value = {“/bin/sling/sample”})
D. Add @SlingServletName(servletName =”AccessControlServlet”) annotation

A

B

Servlets registered by path don’t have access to a resource through the request, and won’t use a resource’s ACLs, and won’t be able to adapt it to a session. Servlets registered to a resourceType will have access to a resource in the request and therefore will have access to that resource’s permissions.
https://sling.apache.org/documentation/the-sling-engine/servlets.html#example-registration-by-resource-type-etc-1

45
Q

A developer is creating a new OSGi bundle com.custom.package.b to expose new services.
com.custom.package.a is already installed and active in the system and has the following package
definition:

Export-Package: com.custom.package.a;version="2.0"
Import-Package: com.sample.package.a;version="[1,2)"
Classpath: .,com.sample.package.b-3.0.jar

The system console shows the following package availability:
~~~
com.sample.package.a;version=”1.5”
com.sample.package.c;version=”3.0”
~~~
Bundle com.custom.package.b to be installed has the following package definition:
~~~
Export-Package: com.custom.package.b;version=”1.0”
Import-Package: com.sample.package.a;version=”[1,2)”,com.sample.package.b;version=”[3.0,3.0]”,com.sample.package.c;version=”[2,3)”
~~~

What will happen when the developer uploads the bundle com.custom.package.b into the system?

A. The bundle will install but fail the activation due to unsatisfied dependencies com.sample.package.b and com.sample.package.c.
B. The bundle will install but fail the activation due to unsatisfied dependency com.sample.package.c.
C. The bundle will install and activate successfully.
D. The bundle will install but fail the activation due to unsatisfied dependency com.sample.package.b.

A

A

https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html

com.custom.package.a is trying to import com.sample.package.a;version="[1,2)".
[1,2) means the version must be greater than and INCLUDING 1.0 and less than, and NOT including 2.0: 1.0 <= x < 2.0

com.custom.package.b is trying to import com.sample.package.a;version="[1,2)",com.sample.package.b;version="[3.0,3.0]",com.sample.package.c;version="[2,3)".
[3.0,3.0] means the version must be exactly version 3.0 for com.sample.package.b
[2,3) means the version must be greater than and INCLUDING 2.0, and less than and NOT including 3.0: 2.0 <=x < 3.0 for com.sample.package.c

Since the system has version 1.5 of com.sample.package.a available, com.custom.package.b will resolve it’s import of com.sample.package.a.
But, com.custom.package.b will not resolve it’s import of com.sample.package.c because it wants a version less than 3, and the only version available is com.sample.package.c;version"3.0"

Also, com.custom.package.b has a jar for com.sample.package.b embedded in it, but it’s not available as it’s not an exported package, so the import for com.sample.package.b will also fail.
https://docs.osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.bundleclasspath