Hi,
I’m running Magnolia 6.2 w/ translated urls (magnolia-urltranslation@5.6) and would like to generate some links during server startup. LinkUtil.createLink(node) would do the job but the problem is that it uses MgnlContext.getAggregationState().getLocale() that needs WebContext, which isn’t available during server startup. I can use urlTranslator directly but there is also URI2repository-mapping involved which seems to be the part that actually requires the aggregation state. Does anybody know an alternative way to make this happen or is this just not possible?
BR, Samuli
Thanks for the example. Looks pretty intimidating and as you said fragile. I was thinking of using it as part of a virtual uri mapping to “autogenerate” i18n paths in fromUri regexses based on default path but I don’t know if it’s such a great idea in the first place even if generating the paths would be easier. Do you happen to know if there is any other options I could consider using virtualUris and i18n urls? At this point I think I will leave it up to the configuration/configurer to handle i18n urls correctly.
BR, Samuli