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 â˜º