D2 v4.5 DQL Editor Widget – Part 1

One function of Webtop that I really miss in D2 is the DQL Editor.  So, as an exercise to learn how to create external D2 widgets that use bi-directional communication, I decided to build one.  Recall that the last D2 widget I build generated a bar code for the selected object in the Doclist widget, but did not employ bi-directional communication with D2 or the Docbase.

The D2 DQL Editor looks and functions similarly to the DQL Editor in Webtop (see figure).  And, as it turned out, was not too difficult to build, once I understood the OpenAjaxHub and its callback structure.  The rest of the widget is implemented as a JSP page with a Java servlet behind it.

DQL Editor

D2 loads external widgets into iFrames.  As part of the configuration of this widget, D2 passes the name of the current user and Docbase in the URL.  JavaScript in the widget parses this information out of the URL when it loads and saves it for use later.  The JSP then instantiate the OpenAjaxHub and subscribes to the D2_EVENT_DM_TICKET_GENERATED message.  When a DQL query is run, the widget publishes a request for a login ticket on the OpenAjaxHub.  Once the ticket is received, the query, the ticket, the user, and the Docbase name are passed to the servlet to be run.

In the following three posts (Parts 2, 3, and 4) I will discuss in more detail the various components of this external D2 widget.

You can download the WAR file and all of the source code for the D2 DQL Editor here.

17 Responses to D2 v4.5 DQL Editor Widget – Part 1

  1. artika4biz says:

    Interesting widget Scott! I think it could be a very interesting example to learn how custom D2 widgets work. Thanks for sharing.

    Yuri Simione

    http://linkedin.com/in/yurisimione

    Like

  2. David L. says:

    Would love to see this on GitHub!

    Like

  3. ian says:

    Hello,

    It is an interesting widget. The link is broken however. Thank you in any case for the great work!

    Like

  4. Pingback: D2 v4.5 DQL Editor Widget – Part 2 | dm_misc: Miscellaneous Documentum Information

  5. Pingback: D2 v4.5 DQL Editor Widget – Part 3 | dm_misc: Miscellaneous Documentum Information

  6. Pingback: D2 v4.5 DQL External Widget – Part 4 | dm_misc: Miscellaneous Documentum Information

  7. ari says:

    Hello ,
    I want to display query result in the standard doclistWidget.

    How do this ?

    Thanks

    Like

  8. Pingback: Fixed Links for D2 v4.5 DQL Editor Part 2 | dm_misc: Miscellaneous Documentum Information

  9. Pingback: D2 v4.5 Inbox Widget — Part 1 | dm_misc: Miscellaneous Documentum Information

  10. Pingback: D2 v4.5 Inbox Widget — Part 2 | dm_misc: Miscellaneous Documentum Information

  11. Pingback: Links to All of My Source Code | dm_misc: Miscellaneous Documentum Information

  12. Pingback: D2 Starter Project

  13. Dipayan Roy says:

    I tried running the widget. But after typing the query once the submit button is clicked the query shows executing and does not fetch a result. Please advise.

    Like

  14. Pingback: Jupyter Notebooks and Documentum – Random Eklektos

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.