Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

need to call the expense fragment data in service call.

Avatar

Avatar
Validate 1
Level 1
mohanasundaramp
Level 1

Like

1 like

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile

Avatar
Validate 1
Level 1
mohanasundaramp
Level 1

Like

1 like

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile
mohanasundaramp
Level 1

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
Establish
MVP
BrianKasingli
MVP

Likes

591 likes

Total Posts

572 posts

Correct Reply

219 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

591 likes

Total Posts

572 posts

Correct Reply

219 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
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
Validate 1
Level 7
KiranVedantam1992
Level 7

Likes

161 likes

Total Posts

164 posts

Correct Reply

48 solutions
Top badges earned
Validate 1
Establish
Give Back 3
Give Back
Boost 50
View profile

Avatar
Validate 1
Level 7
KiranVedantam1992
Level 7

Likes

161 likes

Total Posts

164 posts

Correct Reply

48 solutions
Top badges earned
Validate 1
Establish
Give Back 3
Give Back
Boost 50
View profile
KiranVedantam1992
Level 7

22-02-2021

Hi @mohanasundaramp,

 

Please find a similar post here

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

591 likes

Total Posts

572 posts

Correct Reply

219 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

591 likes

Total Posts

572 posts

Correct Reply

219 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

22-02-2021

DELETED