Get selected object's ID on custom dialog in D2

edited August 4, 2014 in Documentum

Hi,

How can i get the selected object's ID on a custom created dialog (using plugin). When i right click on the object and choose a custom menu option like "Modify", I want an action to be called that would popup the dialog having the selected object's ID.

Thanks and Regards,

Abhishek

Comments

  • edited March 11, 2014

    Hi.

    Did you find a solution to your requirement? I have a similar requirement and would be glad for some help.

    Best Regards,

    Stefan

  • edited March 11, 2014

    Hi Stefan,

    I trying the same. If i am trying to do it, i will let you know.

  • edited May 13, 2014

    Hi All,

               I'm in need of such same requirement. Please some one post an answer with sample code and snapshot.

    Thanks in advance.

  • edited June 25, 2014

    Hi All,

    I also have the similar requirement.If any one of you found a solution ,please share.

    Thanks in advance

  • edited August 4, 2014

    Hi,

    You will get selected object Id in your custom dialog plugin from D2fsContext context parameter in follwoing method

    public XmlNode buildDialog(D2fsContext context, List<Attribute> attributes).

    see below code snippet:

    public XmlNode buildDialog(D2fsContext context, List<Attribute> attributes){

        IDfPersistentObject persistentObject = context.getFirstObject();  

        if ((persistentObject != null) || ((persistentObject instanceof IDfSysObject)))

        {

          IDfSysObject sysObject = (IDfSysObject)persistentObject;

            IdfId selected_Id =  sysObject.getObjectId();

    }

  • But D2fsContext context parameter always have one object in it even when the dialog is triggered from multi document selection. Any solution to get the context of all selected documents in custom Dialog?

  • OfiTecOfiTec Ruth Larrea

    D2fsContext contains all selected documents. Code for getting all objects:

    ArrayList<IDfPersistentObject> objList = new ArrayList<IDfPersistentObject>();
            for (int i = 0; i < d2fsContext.getObjectCount(); ++i) {
                objList.add(d2fsContext.getObject(i));
    }
    

    Hope it helps someone.
    PL

Sign In or Register to comment.