D2 Dialog to import a document


We are are working with D2 4.7 versión, and we are trying to import a document by a dialog (extends AbstractDialog implements ID2Dialog ).
We have created the property file, the dialog and action java class, and the XML.

We have use a file tag into the XML, to import the document, like the attached file.

My question, is how can we get the file into the server, becouse in the context or D2Fcontext, we only have the path of the file (from client side, obviously). Is there a way to get the file (like a do-post method in HTML) using the dialog?

best regards

Best Answer

  • Accepted Answer

    Can you help answer this question?

    We have noticed this question is over 30 days old and hasn't received a response. We're turning to you, the community, to help answer it.

    This generic response is intended to prompt discussion in this post. The question remains open to your answers, suggestions, and best practices.

    If you posted this question and were able to resolve the issue, please share your solution here with others. If you still need additional help, though, please let us know. Your question and its resolution are important to us, and we want to help.

    • Please note that questions to the developer network are typically peer-to-peer, best effort responses.
    • Additionally, note that posting questions to General may not be answered by a product expert. The General forum is for non-product questions. Please be sure to post your product-specific questions to the proper product forum.

    David Sciuto


  • I've the same problem, any solution? Thanks!

  • PedroMaiaPedroMaia Senior Consultant (OpenText) EM

    I am not sure what you are trying to achieve here... why a customization when you can configure the import of files only with D2 configurations? You just need to define Creation Profile and a Property Page to configure the file import - if you need some customizations you can then use a D2-Plugin...

    Pedro Maia
    Senior Consultant

  • I just want to be able to register a document in one step, with a dialogue that asks for a document to import and the properties. The client complains that all the steps appear on the left side (select template, linked documents ..) and that he has to go through all of them without doing anything.

  • PedroMaiaPedroMaia Senior Consultant (OpenText) EM
    edited April 1

    You should be able to configure the Import process so there are only 2 steps:
    1 - Choose the file to import, click Next
    2 - Choose the document's metadata and then click Next to finish.

    Pedro Maia
    Senior Consultant

  • Yes, I have it. But it also goes through the rest of the steps without stopping and the client would like the steps of selecting template and linking documents not to appear because they do not understand them.

  • AFAIK, you cannot do what you want (OOTB). You can extend the import widget changing the first step (select file), and, if you don't have templates (or there's only one that can be applied), that step can be skipped through configuration. But you cannot modify in any other way (that I know of) the importmanager.

    If you want to develop your own dialog, you can then implement a custom upload servlet and use that to upload documents.

  • Thanks Alvaro,

    How can I create a custom servlet from a dialog that extends AbstractDialog implements ID2Dialog. I can not find the way to get the request from the personalized dialog.

    Thank you very much again!

  • You have to create a servlet that receives a file and uploads to Documentum, this has nothing to do with the dialog, this should be a standard servlet added to D2's web.xml.

    Then you need to send the file to that servlet from the dialog, as you would do with any form from an html page.

  • Thanks very much Andrés, I find it interesting... can you put html code inside the xml dialog?

  • @aballesterost said:
    Thanks very much Andrés, I find it interesting... can you put html code inside the xml dialog?

    Not as far as I know

  • I've got it!
    I have inserted html code into a custom dialog.
    These are the steps:

    1. In the dialog.xml file, an item of type comment has been added with the property html content = true and in label tag you can enter all the html code you want.
    2. To facilitate the task, the code I have entered is a borderless iframe that refers to an external html file that can receive parameters from the dialog itself and interacts with D2 through rest services.

      <comment height = "500px" id = "iframenexos" advancedView_enabled = "false" html_content = "true"
    label_en = "& lt; iframe frameborder = '0' width = 100% height = '500px' src = 'html / importci.html? id = $ value (id)'> </ iframe & gt;
    label_en = "& lt; iframe frameborder = '0' width = 100% height = '500px' src = 'html / importci.html? id = $ value (id)' & gt; & lt; / iframe & gt;"

  • Thanks for posting back to community. Who knew you could do something this powerful from config perspective :)

Sign In or Register to comment.