D2 v4.5 DQL Editor Widget – Part 4

In the last post of this series I will discuss how to install and configure the D2 DQL Editor external widget. To recap:

  • Part 1 – overview of widget design,
  • Part 2 – discussion of JavaScript and OpenAjaxHub implementation,
  • Part 3 – discussion of Java servlet to run query and format results.

Installation and configuration of the D2 DQL Editor widget occurs in three easy steps:

  1. First, install the D2DQL.war file on your application server (I only tested with Tomcat). The WAR should contain all of the necessary DFC, dmRecordSet, and DCTMBasics JARs (in /WEB-INF/lib), in addition to the DQLQueryServlet.class class file, D2DQLEditor.jsp JSP file, and DQL.css style sheet.  The directory structure should look like this:
    • ../webapps/D2DQL
      • D2DQLEditor.jsp
      • /META-INF
      • /resources
        • DQL.css
        • D2-OAH.js
        • OpenAjaxManagedHub-all.js
      • /WEB-INF
        • /lib
          • aspectjrt.jar
          • certFIPS.jar
          • commons-lang-2.4.jar
          • DCTMBasics.jar
          • dfc.jar
          • dmRecordSet.jar
          • jsafeFIPS.jar
          • log4j.jar
        • /classes/com/dm_misc/D2
          • DQLQueryServlet.class
  2. In D2-Config, configure a new widget using the settings below (you may need to adjust the URL for your environment).  See the EMC Documentum D2 v4.5 Administration Guide for details on configuring new widgets D2 configurations.
    • Name:  D2DQL
    • Label and Description:  D2DQL
    • Widget Type: ExternalWidget
    • Widget URL:  http://localhost:8080/D2DQL/D2DQLEditor.jsp?user=$USER&docbase=$DOCBASE
    • Bi-directional Communications:  checked
    • Communication Channels:  D2_ACTION_DM_TICKET_GENERATE

D2DQL-D2-Config

  1. Configure the D2DQL widget on a D2 workspace and configure it in the Configuration Matrix appropriately.

Login to D2, open your workspace, and run a query.

D2DQLEditor

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

I hope this series of blog posts on building the D2 DQL Editor have been valuable to you.  I find the widget itself useful and the experience of developing it incredibly valuable.  I hope to build additional D2 external widgets using this model in the future.

Leave me a comment, I’d be happy to hear your thoughts.

Advertisements

About Scott
I have been implementing Documentum solutions since 1997. In 2005, I published a book about developing Documentum solutions for the Documentum Desktop Client (ISBN 0595339689). In 2010, I began this blog as a record of interesting and (hopefully) helpful bits of information related to Documentum, and as a creative outlet.

14 Responses to D2 v4.5 DQL Editor Widget – Part 4

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

  2. Jericho Ruz says:

    Very Valuable, in fact I’m using it as a start point to Widgets further development ’cause it’s easy than connect external Widgets with the registry. Thanks a lot man

    Like

  3. Mitesh says:

    After writing query and submit – not getting any response…

    Like

  4. Mitesh says:

    After adding required widget, on click of submit query – only getting message of submit query.
    Submitting query for execution…
    no response .. getting following error in D2log

    com.emc.common.dctm.exceptions.C6ObjectNotFoundByNameException: Image object “xcpbg_pattern.png” not found.
    at com.emc.common.dctm.utils.DfSessionUtil.getObjectByName(DfSessionUtil.java:234) [DfSessionUtil.class:na]

    at com.emc.x3.api.config.image.X3Image.getInstanceByName(X3Image.java:92) [X3Image.class:na]
    at com.emc.d2fs.dctm.web.services.config.D2X3ConfigService.getDataHandler(D2X3ConfigService.java:1143) [D2X3ConfigService.class:na]
    at com.emc.d2fs.dctm.web.services.config.D2X3ConfigService.buildX3SkinFromConfig(D2X3ConfigService.java:1114) [D2X3ConfigService.class:na]
    at com.emc.d2fs.dctm.web.services.config.D2X3ConfigService.getSkin_aroundBody10(D2X3ConfigService.java:595) [D2X3ConfigService.class:na]
    at com.emc.d2fs.dctm.web.services.config.D2X3ConfigService$AjcClosure11.run(D2X3ConfigService.java:1) [D2X3ConfigService$AjcClosure11.class:na]
    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:221) [JoinPointImpl.class:na]

    2016-11-01 16:45:12 [INFO ] [http-nio-9092-exec-15] – c.e.x.p.s.s.s.RpcSpaceServiceImpl[ ] : Saving user workspaces
    2016-11-01 16:45:30 [INFO ] [http-nio-9092-exec-14] – c.e.x.p.s.s.w.RpcWidgetServiceImpl[ ] : Context D2_45_DOC-1477998907090-dmadmin-1942748551 with config D2DQL, ID null and URL null

    Like

    • Scott says:

      It looks like something in D2 is not configured properly. Do other D2 apps run correctly? Does the starter app work, http://wp.me/pUBnP-13L?

      Like

      • Mitesh says:

        Yes starter project works fine… able to perform all content related operations as well.

        Like

      • Scott says:

        Hmmm. Looking at the stack trace D2 is trying to find an image file, xcpbg_pattern.png. I am not familiar with this image file and no longer have access to a D2 instance to troubleshoot it. Do you have another D2 installation you can reference and see if you can locate this file? No guarantee that’s really the problem. At the end of the stack trace I see something about an ID is null.

        Like

      • Mitesh says:

        True probable reason of problem is due to ID is null.. any idea? why that is coming.

        Like

      • Scott says:

        Are you sure you have the widget configured properly in D2-Config (the correct URL string and the correct message channel)? Also, make sure the D2-OAH.js file is accessible. There is a D2 “message debugger” where you can see all the messaging on the OAH. I don’t recall where I found it, I think it might have been part of a Momentum presentation a few years back. Google can probably find it. Anyway, if you install that it might help to reveal where the problem is.

        Like

      • Mitesh says:

        Yes, able to get output by adding dfc.properties from D2 to D2DQL web-inf/classes. after adding alerts and sysout in servlet code helped.

        Thank you.

        Like

      • Scott says:

        Ah! Glad you have it working.

        Like

      • Mitesh says:

        Thank you for such well documented and sample source, now i got more interest to wok on external widget, custom plugin and D2FS, i find very limited documents as D2 Developer guide. Do you have any more references on this to do more hands on. thank you.

        Like

      • Scott says:

        Your welcome! Glad I could help.
        I agree that developer documentation is a bit lacking. Most of what I learned about D2 and developing external widgets has been trial and error. I found a few helpful presentations from Momentum 2014 and the D2 developers’ guide. The links to these resources are in this blog post: https://msroth.wordpress.com/2015/10/12/d2-v4-5-dql-editor-widget-part-2/. Other than that, I searched the EDN and Google and asked questions in the forums.

        Like

  5. Soraya says:

    Hello Scott!
    Thank you for your tutorial, It’s very interesting!
    I am trying to make the widget work, but when I try to make the connection to a Documentum with “logon” class, but xmlhttp.status returns 404 and I can’t make it work. The servlet class works correctly, because i tried send and receive some parameters. Could you help me?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: