D2 v4.5 DQL Editor Widget – Part 1
October 7, 2015 17 Comments
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.
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.
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
LikeLike
Would love to see this on GitHub!
LikeLike
Hello,
It is an interesting widget. The link is broken however. Thank you in any case for the great work!
LikeLike
Sorry about the broken link, it should be fixed now.
LikeLike
Pingback: D2 v4.5 DQL Editor Widget – Part 2 | dm_misc: Miscellaneous Documentum Information
Pingback: D2 v4.5 DQL Editor Widget – Part 3 | dm_misc: Miscellaneous Documentum Information
Pingback: D2 v4.5 DQL External Widget – Part 4 | dm_misc: Miscellaneous Documentum Information
Hello ,
I want to display query result in the standard doclistWidget.
How do this ?
Thanks
LikeLike
Hi Ari,
I’ve seen this done before, I think it might be included in one of the Momentum examples I cited as a reference (https://community.emc.com/docs/DOC-35143). The only problem with this approach is you are limited in the the columns you can return in your result (they are fixed by the DocList) and you can only return dm_documents.
LikeLike
Pingback: Fixed Links for D2 v4.5 DQL Editor Part 2 | dm_misc: Miscellaneous Documentum Information
Pingback: D2 v4.5 Inbox Widget — Part 1 | dm_misc: Miscellaneous Documentum Information
Pingback: D2 v4.5 Inbox Widget — Part 2 | dm_misc: Miscellaneous Documentum Information
Pingback: Links to All of My Source Code | dm_misc: Miscellaneous Documentum Information
Pingback: D2 Starter Project
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.
LikeLike
Please advise if someone have also faced the same issue and knows the resolution.
LikeLike
Pingback: Jupyter Notebooks and Documentum – Random Eklektos