With a number of versions of SDL Tridion, SDL Web (and soon to be SDL Tridion Sites) out there with Alchemy users, our latest version of the plugin development framework contains some major updates for the core service.
The framework now detects the version of the CMS environment and knows which version to use.
Here’s how you can create your new client object:
var client = Alchemy4Tridion.Plugins.Clients.SessionAwareCoreServiceClient;
Note: I’m showing full namespaces in the code sample here, normally I’d call Clients….
We’ve wrapped the coreservice inside:
So if you wish to create an object using this client, say for example a PublicationData object, here is how you would obtain that information:
Alchemy4Tridion.Plugins.Clients.CoreService.PublicationData pubData = (Alchemy4Tridion.Plugins.Clients.CoreService.PublicationData)client.Read(“tcm:0-1-1”, new Alchemy4Tridion.Plugins.Clients.CoreService.ReadOptions()); publicationName = pubData.Title;
It’s now possible to completely remove SDL’s coreservice DLL from your .net project, which I’d recommend so there’s no mix up when building your plugin ☺