Site Developer Flashcards
A developer needs to create a banner component. This component shows an image across the full width of the page. A title is shown on top of the image. This text can be aligned to the left, middle, or right. The core components feature a teaser component which matches almost all requirements, but not all.
What is the most maintainable way for the developer to implement these requirements?
A.Use and configure the teaser core component.
B.Create a new custom component from scratch.
C.Inherit from the teaser core component
D.Overlay the teaser core component.
C
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 be wrapped 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/>
a href=”${item.link}”/>${“Read more” @ il8n}” a/>
B. sly data-sly-use.model=”com.example.component”/>
div data-sly-list=”${model.pages}”/>
p>${item.title} p/>
a href=”${item.link}”/>${“Read more” @ .translate}” a/>
C. sly data-sly-load.model=”com.example.component”/>
div data-sly-list=”${model.pages}”/>
p>${item.title} p/>
a href=”${item.link}”/>${“Read more” @ il8n}” a/>
D. sly data-sly-use.model=”com.example.component”/>
div data-sly-list=”${model.pages}”/>
p>${item.title} p/>
a href=”${item.link}”/>${“Read more” @ .translate}” a/></div>
A
A developer is working on a complex project with multiple bundles. One bundle provides an OSGi service for other bundles.
Which two options are necessary to ensure that the other bundles can reference that OSGi service? (Choose two.)
A.The bundle providing the service needs to export the java package of the service interface
B.The service needs to correctly declare metatype information.
C.The bundle providing the service needs to contain a whitelist of allowed consumer bundles.
D.The bundles consuming the service need to import the fully qualified name of the service interface
E.The bundle providing the service needs to contain an adequate SCR descriptor file.
A, D
The structure section of an editable template has a locked component.
What happens to the content of that component when a developer unlocks it?
A.The content stays in the same place but it ignored on pages using the template.
B.The content is deleted after confirmation from the template author.
C.The content is moved to the initial section of the editable template.
D.The content is copied to the initial section of the editable template
C
Which log file contains AEM application request and response entries?
A.response.log
B.request.log
C.history.log
D.audit.log
B
A developer identifies that some requests for the page /content/sampleproject/page.html take longer that other requests for the same page.
How should the developer make sure that the page is always cached?
Modify the dispatcher.any file to contain the following lines:
A. /filter
/0023 { /type “allow” /url “/content///html” /params “tracking_id”}
B. /igoneUrlParams
/0002 { /glob “tracking_id” /type “allow”}
C. /rules
/0000 { /glob “*” /type “allow” /params “tracking_id” }
D. /filter
/0023 { /type “allow” /url “/content///html?tracking_id=*”}
B
A developer creates a Sling Servlet. The Sling Servlet is bound to a path (/service/sling/sample).
@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.Modify @SlingServletPaths(value = {“/bin/sling/sample” }).
B.Add @SlingServletName(servletName = “AccessControlServlet”) annotation.
C.Use @SlingServletResourceTypes instead of @SlingServletPaths.
D.Add @SlingServletPrefix(value = “/apps”) annotation.
C
A developer wants to extend AEM Core Components to create a custom Carousel Component.
How should the developer extend the Core Components?
A.Make changes to the original component and assign a component group.
B.Use the sling:resourceType property to point to the core component.
C.Copy the Core Carousel component to /apps/ folder.
D.Use the sling:resourceSuperType property to point to the core component.
D
A developer wants to change the log level for a custom API.
Which OSGi configuration should the developer modify?
A.Apache Sling Log Tracker Service
B.Apache Sling Logging Writer Configuration
C.Adobe Granite Log Analysis Service
D.Apache Sling Logging Configuration
D
Refer to the following four Client Library Folders.
Html
One
- categories=”[library.one]”
- dependencies=”[library.three, library.four]”
- embed=”[library.two]”
Two
- categories=”[library.two]”
Three
- categories=”[library.three]”
- dependencies=”[library.four]”
Four
- categories=”[library.four]”
A developer uses the following:
data-sly-call=”${clientlib.css @categories=’library.one’}”
What is the resulting HTML?
A. href=”library.one.css”
href=”library.three.css”
href=”library.four.css”
B. href=”library.two.css”
href=”library.one.css”
href=”library.three.css”
C. href=”library.four.css”
href=”library.three.css”
href=”library.one.css”
D. href=”library.three.css”
href=”library.four.css”
href=”library.one.css”
C
A developer is installing a content package with the package manager. The developer needs to restrict the approximate number of nodes in a batch that is saved to persistent storage in one transaction.
How should the developer modify the number of transient nodes to be triggered until automatic saving?
A.Change the value of Save Threshold in the Install Package dialog-box
B.AEM instances automatically modify the number of transient nodes based on the load balancing.
C.Modify the export package manifest header and copy the content package to AEM installation folder.
D.Select the option MergePreserve for the Access Control Handling drop-down in the Install Package dialog-box.
A
A developer needs to implement a service component that should be manually configured by operations to react on operational circumstances. The service component should NOT be active by default. The service has the properties myservice.name (one string value) and myservice.stringValues (a list of the string values) to be configured.
The developer needs to use OSGi Metatype annotations to make those properties configurable in the Apache Felix Web Console.
Which set of steps should the developer take to meet these requirements?
A.1. For the class fields myserviceName and myserviceStringValues, add a @AttributeDefinition annotation each with names set to myservice.name and myservice.stringValues respectively. 2. Use the @Component annotation with configurationFactory = true on the service component class. 3. Use the @Service service component class. 4. Use the activate method of the service component class to get the configuration annotation interface class injected.
B.1. Create an annotation interface as inner class of the service component and annotate it with @ObjectClassDefinition. 2. Apply @AttributeDefinition for the methods myservice.name and myservice.stringValues. 3. Use the @Component annotation with configurationPolicy = ConfigurationPolicy.REQUIRE on the service component. 4. Use the @Designate annotation to link the service component to the created configuration annotation interface. 5. Use the activate method of the service component class to get the configuration annotation interface class injected.
C.1. For the class fields myserviceName and myserviceStringValues, add a @Property annotation each with names set to myservice.name and myservice.stringValues respectively. 2. Use the @Component annotation with configurationFactory = true on the service component class. 3. Use the @Service service component class. 4. The configuration is automatically injected into the field by the service component runtime.
D.1. Create an annotation interface as inner class of the service component and annotate it with @ObjectClassDefinition. 2. Apply @AttributeDefinition for the methods myservice_name and myservice_stringValues. 3. Use the @Component annotation with configurationPolicy = ConfigurationPolicy.REQUIRE on the service component. 4. Use the @Designate annotation to link the service component to the created configuration annotation interface. 5. Use the activate method of the service component class to get the configuration annotation interface class injected.
D
A developer creates Editable Templates based on a custom Page component. The developer wants to leverage the Style System within the Editable Templates to allow authors to switch between the Dark and Light Theme. The Style System dialog is NOT enabled for the site.
What should the developer do to resolve this issue?
A.Create two new client libraries with a dark and light theme and map them to the Page component.
B.Set the sling:resourceSuperType property to core/wcm/components/page/v2/page on the Page component.
C.Define Style Definitions using Page Policy dialog on Editable Template.
D.Create a new dialog for the custom Page components.
C
A developer creates a custom component. The component dialog includes the following fields:
charLimit
- defaultValue=”0”
- name=”./chatLimit”
The developer creates the following Sling Model to perform the trancation:
@ValueMapValue
private Integer charLimit;
@PostMapValue Private void init(){ If(0 < charLimit) //perform process }
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.Replace the defaultValue=”0” attribute of the charLimit field in the dialog with defaultValue=”{Long}0”.
C.Add the @Default annotation to the “˜chatLimit’ variable in the Sling Model.
D.Change the defaultInjectionStrategy of the Truncation Sling Model to DefaultInjectionStrategy.REQUIRED.
C
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: the dependency via Import-Package is enough to ensure correct installation.
D.Embed both bundles in one content package and use property “˜installationOrder’ in package properties for correct bundle installation order.
C
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 pid>»_space; threaddumps.log, analyze thread dumps to find long running sessions.
B.Go to Tools > Operations > Monitoring. Create a new report based on Number of Active Sessions as metric.
C.Go to Web Console > Status > Threads, verify the overall thread count.
D.Go to aem-install>/crx-qiuckstart/logs/strderr/log, use the following command grep -o “˜CRXSessionImpl’ strderr.log| wc -l.
B
An OSGi bundle Activator.java is registered through a service DevelopInfo.java
DeveloperInfo java:
Package com.adobe.training.core
public interface DeveloperInfo{
}
Activator java: @component(service=DeveloperInfo.class) public class Activator{ public void start(){ } }
Maven install generates an error during deployment.
Which action should the developer take to resolve the build error?
A.@Service annotation is missing in DeveloperInfo.java.
B.Interface DeveloperInfo does NOT have any method.
C.The required Maven repository for OSGi is missing.
D.Activator class is NOT implementing DeveloperInfo interface.
D
An online insurance company website has user-generated content that must be replicated in all publish instances.
What action should the developer take to achieve this?
A.Configure the dispatcher flush agent in publish instance.
B.Configure the replication agent in the publish instances.
C.Disable static agent in the author instance
D.Configure reverse replication agents for the author.
D
A developer needs to analyze log messages for custom Java application. The developer writes the following Java class:
Private static final Logger logger = LoggerFactory.getLogger(this.class);
logger.debug(“asd”);
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 web console to view the above message?
A.Sling-> Log Support and click logs/custom.log
B.OSGi -> Log Service and click logs/custom.log
C.Sling -> Metrics and click logs/custom.log
D.AEM -> Log Support and click logs/custom.log
A
A developer must create a workflow step that assigns a "˜WorkItem' to the appropriate person based on who has the least amount work to do. The group that must perform the action is configured into the workflow. Which non-deprecated interface should the Java implementation class use to perform the assignment?
A.com.day.cq.workflow.exec.ParticipantChooser
B.com.day.cq.workflow.exec.WorkItem
C.com.adobe.granite.workflow.exec.ParticipantStepChooser
D.com.adobe.granite.workflow.exec.WorkflowData
C
A developer needs to create an OSGi service to run on an Author instance and send out newsletters at periodic intervals. Intervals should be customized using the
Web Console Configuration. Concurrent execution must be prevented.
Which code snippet should a developer use to achieve?
A java with
scheduler_expression and scheduler_concurrent
From which AEM Web Console should a developer access and download full AEM Log Files?
A.Status -> Log files
B.Web Console -> System Information
C.OSGI -> Sling Log Service
D.AEM -> Log files
A
A developer needs to create a new component called “Component A”. Component A must show a list of other components that all have a resource type of existing “Component B”. Component A must render this list of tiles for each Component B where the tile rendering is different from the default one. The list of rendered tiles must be reusable by future new components.
How should the developer implement this functionality?
A.Component A overlays Component B and overwrites the base renderer to facilitate the tiles.
B.Component A inherits from Component B and overwrites the base renderer to facilitate the tiles.
C.Create a script for tile rendering in Component B and use data-sly-resource attribute with a Sling selector in Component A to render the tile.
D.Component A calls the HTL of Component B directly using a data-sly-include attribute
C
For each CRX node in the hierarchy, which actions can be configured using the user admin interface?
A.Read, Write, Read ACL, Edit ACL, Replicate
B.Read, Modify, Create, Delete, Read ACL, Edit ACL, Replicate
C.Read, Write, Delete, Edit ACL, Replicate
D.Read, Modify, Create, Delete, Read ACL, Edit ACL
B
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 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(…).
C.Create a configuration line in PID com.day.cq.security.ACLSetup for the user that you obtain a session for via ResourceResolverFactory.getResourceResolver(…).
D.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.
B
A developer determines that the dispatcher is NOT refreshing the cached page /content/sampleproject/sample.html after it is updated.
The dispatcher.any contains the following entries:
/rules
{
/0000 {/glob “*” type “allow”}
}
/invalidate
{
/0000 {/glob “*” type “deny”}
}
The dispatcher needs to cache the page and refresh it after it gets updated.
What action should the developer take to meet these requirements?
A.Remove /statfile or /statfileslevel.
B.Delete the contents of the DOCROOT directory.
C.Change the value of the entry /statfileslevel to “3”.
D.Add the entry /0001 { /glob “-.html” /type “allow” } in the /invalidate section.
D
A developer is creating a custom method. This method must return a String property y from child x. the method must use only Sling APIs.
How should the developer retrieve property y of node x, and node x may or may NOT exist?
A.
String y = ((ValueMap) resource.getChild(“x”).getValuemap())
B. String y=null; Node x = node.getNode("x"); If(null!=x){ Properties properties = x.getProperties(); If(null!=properties){ y=properties.get("y",""); } }
C. String y=null; Resource x = resource.getChild("x"); If(null!=x){ ValueMap map = x.getValuemap(); If(null!=map){ y=map.get("y",""); } }
D. String y=null; Node x = node.getNode("x"); If(null!=x){ ValueMap map = x.getValuemap(); If(null!=map){ y=map.get("y",""); } }
C
The custom AEM application needs to keep a flat list of all page paths underneath /content/thesite in memory for a real-time integration with high performance requirements.
What action should the developer take to meet these requirements?
A.
Make the class implement ResourceChangeListener and add
property = {
ResourceChangeListener.CHANGES + “=ADDED”
ResourceChangeListener.CHANGES + “=REMOVED”
ResourceChangeListener.Primary_TYPES + “=cq:Page”
ResourceChangeListener.PATHS + “=/content/thesite”
}
To the @Component annotations. In method onChange update field pagePaths accorsing to receivedlist of ResourceChange
B.
Make the class implement ResourceChangeListener and add
property = {
ResourceChangeListener.CHANGES + “=ADDED”
ResourceChangeListener.CHANGES + “=CHANGED”
ResourceChangeListener.CHANGES + “=REMOVED”
ResourceChangeListener.PATHS + “=/content/thesite”
}
To the @Component annotations. In method onChange filter receive list of resource change for pages only and adjust field pagePath accordingly
C.
Make the class implement ResourceChangeListener and add
property = {
ResourceChangeListener.CHANGES + “=ADDED”
ResourceChangeListener.CHANGES + “=REMOVED”
ResourceChangeListener.Primary_TYPES + “=cq:Page”
ResourceChangeListener.PATHS + “=/content/thesite”
}
To the @Component annotations. In method onChange update field pagePaths accorsing to receivedlist of ResourceChange
D.
Make the class implement ResourceChangeListener and add
property = {
ResourceChangeListener.CHANGES + “=ADDED”
ResourceChangeListener.CHANGES + “=REMOVED”
ResourceChangeListener.PATHS + “=/content/thesite”
}
To the @Component annotations. In method onChange filter receive list of resource change for pages only and update field pagePath accordingly
D.
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
Which mode structure should the developer use to meet these requirements?
A. \+ component - jcr:primaryType="cq:Component" - jcr.title="Component" - cq:actions="[edit]" \+ cq:dialog ...
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" - componentGroup=".hidden" \+ cq:dialog ... \+ cq:editConfig - cq:actions="[edit]"
D. \+ component - jcr:primaryType="cq:Component" - jcr.title="Component" - hidden="true" \+ cq:dialog ... \+ cq:editConfig - cq:actions="[edit]"
C
A developer is creating templates and/or components using CRXDE Lite. The developer needs to check the files into source control.
Which tool should the developer use to achieve this goal?
A.Content Explorer
B.http://localhost:4502/crx/checkout
C.mvn command
D.vlt command
D