Hi,
Any one help how to read in experience fragment data into service level.
Thanks,
Mohan
Solved! Go to Solution.
Views
Replies
Total Likes
Reading an experience fragment from a OSGI service will be the same way as accessing a resource and valueMap from the CRXDE.
Optional<Resource> contentFragmentCarousel = Optional.ofNullable(resolver.getResource("/content/experience-fragments/my-site/offers/latest-offers/master/jcr:content/root/carousel"));
String myCustomPropValue = contentFragmentCarousel
.map(Resource::getValueMap)
.map(e -> e.get("myCustomProp", String.class))
.orElse("defaultText");
Reading an experience fragment from a OSGI service will be the same way as accessing a resource and valueMap from the CRXDE.
Optional<Resource> contentFragmentCarousel = Optional.ofNullable(resolver.getResource("/content/experience-fragments/my-site/offers/latest-offers/master/jcr:content/root/carousel"));
String myCustomPropValue = contentFragmentCarousel
.map(Resource::getValueMap)
.map(e -> e.get("myCustomProp", String.class))
.orElse("defaultText");
DELETED
Views
Replies
Total Likes
Views
Likes
Replies