Adobe AD0-E134 Adobe Experience Manager Sites Developer Exam Practice Test

Page: 1 / 14
Total 50 questions
Question 1

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



Question 2
Question 3

A development team is starting a new AEM project that is going to integrate with the Adobe Commerce platform. The developer needs to create a new AEM project using the Maven command line interface.

How can the 'mvn -B archetype:generate' command help the developer with the integration between AEM and Adobe Commerce?



Question 4

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 5

A developer needs to create a runmode-specific OSGi configuration for an AEM as a Cloud Service implementation. In which location should the OSGi configuration be created?



Question 6
Question 7
Page:    1 / 14   
Total 50 questions