tridiontridion-2011tridion-core-services

How to check whether current component is checkout as well as the user details who checkout using tridion coreservices


I want to write small function to check whether passed Item Object is checkout in Tridion or not if yes then it will return "true" and also I want to get the details of user who has checkout the Item, using Tridion 2011 core services.

I know we have TryCheckout as well as Checkout in our CoreServiceClient but it returns Identifiable Object only.


Solution

  • You need to look at the LockType on the item. Consider doing something like this

    SessionAwareCoreService2010Client client = new SessionAwareCoreService2010Client();
    ComponentData data = (ComponentData)client.Read("tcm:300-85609", new ReadOptions());
    FullVersionInfo info = (FullVersionInfo)data.VersionInfo;
    

    The full version info contains all the info you need (i.e. CheckOutUser and LockType). LockType is an Enumeration defined by Tridion.ContentManager.Data.ContentManagement.LockType, and includes the following set of flags: