Free AD0-E134 Exam Braindumps (page: 5)

Page 4 of 13

A custom component has one dialog field:



The developer needs to implement a Sling Model to perform a business logic on the authored value.
The developer writes the following HTL snippet.



Which two implementations will support this HTL snippet? (Choose two.)









Answer(s): B,D

Explanation:

Option B and Option D are two implementations that will support the HTL snippet.
Option B uses the @Model annotation with the adaptables parameter set to Resource.class. This allows the Sling Model to adapt from a resource object and access its properties using the ValueMap interface.
Option B also uses the @Inject annotation with the name parameter set to "./text" to inject the value of the text property into the text field.
Option D uses the @Model annotation with the defaultInjectionStrategy parameter set to OPTIONAL. This allows the Sling Model to use optional injection for all fields and avoid null pointer exceptions if a property is missing.
Option D also uses the @Inject annotation without any parameters to inject the value of the text property into the text field, using the field name as the default property name.


Reference:

https://sling.apache.org/documentation/bundles/models.html https://experienceleague.adobe.com/docs/experience-manager-htl/using-htl/htl-block- statements.html?lang=en#use



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 - <component text>)
3. The component must be reusable
Which approach is recommended?

  1. 1. Create a Proxy Component of Title core component
    2. Create a Custom Sling Model that overrides the default behavior
    3. Customize the component template
    B, 1. Create a custom component from scratch
    2. Create a Custom Sling Model for the component that follows the requirement
    3. Create a Model Exporter
  2. 1. Create a Proxy Component from Title core component
    2. Create a Custom Sling Model that overrides the default behavior

Answer(s): A

Explanation:

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.


Reference:

1 Using Core Components section 2 Create Proxy Component in AEM section 3 AEM- Create Proxy Component section 4 Proxy Components in AEM 6.4 section 5 AEM Proxy Component Pattern and Component Versioning section



A developer needs to create sling models for two fields name and occupations. The dialog has two fields, name - a single value field, and occupations - a multi value field. The following code is included in sling models inherited from interface com.adobe.aem.guides.wknd.core.models.Byline









Answer(s): C

Explanation:

Option C is the correct implementation for the Sling Model.
Option C uses the @Model annotation with the adaptables parameter set to Resource.class. This allows the Sling Model to adapt from a resource object and access its properties using the ValueMap interface.
Option C also uses the @Inject annotation with the name parameter set to "./name" and "./occupations" to inject the values of the name and occupations properties into the name and occupations fields.
Option C also uses the @Named annotation with the value parameter set to "byline" to specify the name of the Sling Model that can be used in HTL scripts.


Reference:

https://sling.apache.org/documentation/bundles/models.html https://experienceleague.adobe.com/docs/experience-manager-htl/using-htl/htl-block- statements.html?lang=en#use



SPA components are connected to AEM components via the MapTo() method. Which code should be used to correctly connect an SPA component called ItemList to its AEM equivalent?

  1. ('project/components/content/itemList,).MapTo(ltemList,ltemListEditConfig);
  2. MapToCproject/cornponents/content/itemList^ltemListJtemListEditConfig);
  3. ItemList.MapToCproject/components/content/itemList1);
  4. MapTo(ltemList)('project/components/content/itemList,,ltemListEditConfig);

Answer(s): C

Explanation:

The MapTo() method is used to map a SPA component to an AEM component by specifying the sling:resourceType of the AEM component as an argument. The MapTo() method should be called on the SPA component and not on a string. The second argument of the MapTo() method is optional and can be used to provide an edit configuration for the SPA component.


Reference:

1 Map SPA components to AEM components section 2 Developing SPAs for AEM section






Post your Comments and Discuss Adobe AD0-E134 exam with other Community members:

AD0-E134 Discussions & Posts