AD0-E116 Exam Question 6

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?
  • AD0-E116 Exam Question 7

    The structure section of an editable template has a locked component.
    What happens to the content of that component when a developer unlocks it?
  • AD0-E116 Exam Question 8

    A custom AEM application 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?
  • AD0-E116 Exam Question 9

    Refer to the following Client Library node structure.
    +clientlibs
    - jcr:primaryType="cq:ClientLibraryFolder"
    - categories="[clientlibs.example]"
    + js.txt
    - jcr:primaryType="nt:file"
    + css.txt
    - jcr:primaryType="nt:file"
    + js
    - jcr:primaryType="nt:folder"
    - javascript1.js
    - javascript2.js
    The js.txt looks like
    javascript1.js
    javascript2.js
    The JavaScript is NOT present in the Client Library when it is loaded.
    What should a developer do to resolve this issue?
  • AD0-E116 Exam Question 10

    A developer needs to configure sets of values according to the following parameters:
    - Varies for different staging environments
    - Varies for different content paths
    - Diffets between author and publish
    Which implementation strategy should the developer use to meet these requirements?