Quick question: is it possible to get data I’ve set on my app’s site.xml from java?
My users will set some settings for the app, and my application’s java controllers are receiving data directly, and they can’t be processed by enonic first, and I really need those settings. Can that be done?
Yes, you can get the values from the site.xml config from Java.
Fetch the Site using ContentService, and then you can get the SiteConfigs, with a config for each app in the site.
In order to get the site, I need to know its name, right? But I won’t have this information. Would it be possible to get all sites from the contentService?
Or a way to get the config for the current app only, without having to meddle with the Sites.
Like, this is the part of the code that interests me:
ApplicationKey thisApp = ApplicationKey.from( getClass() );
SiteConfig siteConfig = siteConfigs.get( thisApp );
But I can’t fill siteConfigs without knowing a name to use in the ContentPath.from().