Adobe Experience Manager Sites Developer AD0-E134 Exam Questions

Page: 1 / 14
Total 50 questions
Question 1

A developer needs to create an OSGI service that is able to read a list of spoken languages from the configuration of the service. The configuration file tanguageServicelmplefgjson' already exisls:

Which snippet should the developer use lo read the OSGi configurations?

A)

B)



Answer : B

To read a list of spoken languages from the configuration of an OSGi service, the correct snippet to use is Option B. This snippet demonstrates how to define and read the configuration properties using the OSGi R7 annotations (@ObjectClassDefinition and @AttributeDefinition), which are the recommended way for defining OSGi configurations in modern AEM projects.

Here is the detailed explanation of the snippet:

Option B Snippet Explanation:

Component Definition:

@Component(

service = { LanguageService.class }

)

@Designate(ocd = LanguageServiceImpl.Config.class)

public class LanguageServiceImpl implements LanguageService {

This defines an OSGi component and designates a configuration class for it.

Configuration Interface:

@ObjectClassDefinition(

name = 'Sample - Language Service',

description = 'OSGi Service providing information about languages'

)

@interface Config {

@AttributeDefinition(

name = 'Sample Languages',

description = 'List of spoken languages'

)

String[] languages() default { 'English', 'Japanese' };

}

This defines the configuration interface with annotations to describe the configuration properties. The languages attribute is defined with a default value of {'English', 'Japanese'}.

Activate Method:

private String[] languages;

@Activate

protected void activate(Config config) {

this.languages = config.languages();

}

The activate method reads the configuration values and assigns them to the instance variable languages when the service is activated.

Here is the complete Option B code:

@Component(

service = { LanguageService.class }

)

@Designate(ocd = LanguageServiceImpl.Config.class)

public class LanguageServiceImpl implements LanguageService {

@ObjectClassDefinition(

name = 'Sample - Language Service',

description = 'OSGi Service providing information about languages'

)

@interface Config {

@AttributeDefinition(

name = 'Sample Languages',

description = 'List of spoken languages'

)

String[] languages() default { 'English', 'Japanese' };

}

private String[] languages;

@Activate

protected void activate(Config config) {

this.languages = config.languages();

}

// Additional methods to use the languages array

}

By using this approach, you ensure that your OSGi service can dynamically read and use the list of spoken languages specified in its configuration, making it adaptable to different environments and requirements.


OSGi R7 Annotations

Adobe Experience Manager - OSGi Configuration

Question 2

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

Question 3

An AEM application requires LDAP Service integration to synchronize users/groups. Which two OSGi configuration are required for LDAP integration in AEM? (Select Two.)



Question 4
Question 5

If multiple configurations for the same PID are applicable, which configuration is applied?



Question 6

A customer is having trouble with some search queries and provides the following information:

* The logs show the following warning occurs many time: WARN* Traversed 1000 nodes with filter Filter (query=select...)

* The client has more than 100,000 stored in their AEM instance

* The client uses a custom page property to help search for pages of a given type

What should the AEM Developer do to help resolve the client's issue?



Answer : A

The warning WARN* Traversed 1000 nodes with filter Filter (query=select...) indicates that the query is performing a traversal instead of using an index. This results in poor performance, especially when the client has a large number of nodes (e.g., more than 100,000).

To resolve this issue, you should create a custom Oak index for the custom page property. This ensures that the queries can leverage the index for efficient data retrieval.

Steps to create a custom Oak index:

Define the Oak Index:

Navigate to the /oak:index node in CRXDE Lite (http://localhost:4502/crx/de).

Create a new node of type oak:QueryIndexDefinition.

Configure the Index:

Set the properties of the new index node to define the indexing rules for the custom page property.

{

'jcr:primaryType': 'oak:QueryIndexDefinition',

'type': 'property',

'propertyNames': ['customPageProperty'],

'reindex': true,

'async': 'async'

}

Deploy and Reindex:

Save the changes and initiate a reindexing process.

Ensure that the reindex flag is set to true for the newly created index.

Validate the Index:

Use the Index Manager or the AEM Web Console to validate that the new index is enabled and functioning correctly.

By creating a custom Oak index for the custom page property, the queries will be optimized to use the index, significantly improving the search performance and resolving the client's issue.


Adobe Experience Manager - Oak Indexing

Apache Jackrabbit Oak - Indexing

Question 7

With AEM as a Cloud Service, which format should be used for the OSGI configuration files?



Answer : C

For AEM as a Cloud Service, the correct format to use for OSGi configuration files is .cfg.json. This format is specifically designed for use in AEM as a Cloud Service and supports both structured and unstructured data, making it versatile for various configuration needs.

Steps to create and deploy OSGi configurations in .cfg.json format:

Create Configuration File: Create a .cfg.json file in your codebase, typically under the apps directory, for example:

/apps/myproject/config/org.apache.sling.commons.log.LogManager.cfg.json

Define Configuration: Add your configuration properties in JSON format:

{

'org.apache.sling.commons.log.level': 'debug',

'org.apache.sling.commons.log.file': 'logs/error.log'

}

Deploy to AEM: Deploy the configuration along with your code package to AEM as a Cloud Service. The configuration will be applied automatically.


AEM as a Cloud Service - OSGi Configuration

Page:    1 / 14   
Total 50 questions