Version of Tridion: SDL Tridion 2013 SP1
Content delivery platform: WAS8 on JDK7
For a custom MVC application I'm trying to determine the publication ID of my context publication from the URL of the request.
For example:
http://mydomain.com/somepath/index.jsp -> publication ID 11
http://mydomain.be/nl/somepath/index.jsp -> publication ID 12
http://mydomain.be/fr/somepath/index.jsp -> publication ID 13
The configuration file cd_dynamic_conf.xml stores this information exactly and apparently certain parts of SDL Tridion Content delivery use this configuration file to make this mapping (at least Experience Manager).
I've found the interface com.tridion.dynamiccontent.publication.MappingsResolver
which appears to do exactly what I would want but the only documented implementing class is MappingsResolverImpl
which requires a com.tridion.configuration.Configuration
object to be passed in it's constructor (which is not documented in the 2013 content delivery API docs).
Have I stumbled on something that is part of the public API by accident? Why is Configuration
not documented in the public API? How do I get a Configuration object? Is there anyone who has ever attempted something similar and has sample code available? Am I even looking at the right part of the Content Delivery API for performing this task?
I know that frameworks ala DD4T use their own mapping configuration in web.config but I was thinking this is a fairly standard use case when combining SDL Tridion with an MVC front-end application so I assumed the API would have something to perform this task (without having to resort to custom-parsing the config files or worse; duplicating the configuration data).