need to call the expense fragment data in service call.

Avatar

Avatar

mohanasundaramp

Avatar

mohanasundaramp

mohanasundaramp

22-02-2021

Hi,

 

Any one help how to read in experience fragment data into service level.

 

Thanks,

Mohan 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

22-02-2021

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");

 

 

 

 

Answers (2)

Answers (2)

Avatar

Avatar

KiranVedantam1992

Avatar

KiranVedantam1992

KiranVedantam1992

22-02-2021

Hi @mohanasundaramp,

 

Please find a similar post here

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

22-02-2021

DELETED