April 9, 2020
Estimated Post Reading Time ~

Shared Component Properties Injector

Purpose
Provides convenience for accessing Shared Properties as implemented by ACS Commons Shared Component Properties.

How to Use
The feature is very similar in usage to the standard ValueMapValue annotation.

Example
@Model(adaptables = {SlingHttpServletRequest.class, Resource.class})
public final class SharedComponentPropsExampleModel {

@SharedValueMapValue(type = SharedComponentProperties.ValueTypes.SHARED)
private String sharedProp;

@SharedValueMapValue(type = SharedComponentProperties.ValueTypes.GLOBAL)
private String globalProp;

// type will be MERGED by default
@SharedValueMapValue
private String mergedProp;
}


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.