Expand my Community achievements bar.

regarding sitemap schedular

Avatar

Level 4

Hi all,
i am using schedular to generate sitemap,but I am not able to adapt ca-config at the time of schedular,

But in case of All-on-demand it working,
Please help me to resolve this problem.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

12 Replies

Avatar

Community Advisor

HI @neeraj_24412 
How're you trying to adapt ca-config for sitemap scheduler? 

Avatar

Level 4

HI @Himanshu_Singhal,
So I need to create sitemap for multi site,

public String getSiteUrl(Resource resource) {
final GlobalConfiguration globalConfiguration = resource.adaptTo(ConfigurationBuilder.class)
.as(GlobalConfiguration.class);
return StringUtils.isNotBlank(globalConfiguration.siteHostUrl()) ? globalConfiguration.siteHostUrl() : "";
}
12neeraj_0-1674483325735.png

This is the output with schedular

12neeraj_0-1674483481822.png

and without schedular it's working fine

12neeraj_1-1674483773689.png

here is my ca-config

12neeraj_2-1674483817658.png

 

Avatar

Community Advisor

Hi @neeraj_24412 

 

Can you tell or add screenshot here that how are you getting the resource which you are passing to addResource Method?

 

Thanks,

Nupur

Avatar

Level 4

Hi @Nupur_Jain,

This is an existing method for creating sitemap,,

So I override it

Avatar

Community Advisor

Can you check which resource is passed to the method while calling the from scheduler ?

Check if both the resources are same in On-demand and from scheduler.

 

 

Avatar

Community Advisor

Below thread explains on the permissions that needs to /conf folder, could you please check if you have enough permissions to read the resource.

If not provide the required permissions and restrict it through the dispatcher.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-3-contextaware-confi...

 

Hope this is helpful

Avatar

Level 4

@Mani_kumar_ I am using this in author instance!
I don't think we need any permission

Avatar

Community Advisor

@neeraj_24412 

 

Can you check if your GlobalConfiguration is null, if resource is same in both the scenarios then it should not be null. Log the resource path and check once. 

Avatar

Level 4

Yeah it's null any solution for this?

 

It is null for all-on-demand too

neerajsankalia_0-1674545426273.png

but somehow I am able to get values from ca-config in the case of all-on-demand

Avatar

Level 4

neerajsankalia_0-1674555979088.png

This one is when all-on-demand enable,
---------------------------------------------------------------------------

neerajsankalia_1-1674556113679.png


This is when using schedular

seems same for both cases