10 Replies Latest reply: Oct 14, 2008 6:12 PM by ro3er RSS

Export operation using DFC


I am using documentum 6.0 and I would like to export a docx document from the content server to my local harddrive. The following is my code:

private void doExport( IDfId docId, String destDir, String exportName, String exportFormat, IDfSession session ) throws DfException {
try {
System.out.println("ServiceRequestMsgBody.java: start doExport 1 - docId: " + docId.toString());

IDfClientX clientx = new DfClientX();
IDfSysObject sysObj = (IDfSysObject) session.getObject( docId );

System.out.println("ServiceRequestMsgBody.java: start doExport 2");

if( sysObj == null ) {
System.out.println("Object " + docId + " can not be found.");

//System.out.println("ServiceRequestMsgBody.java: start doExport 2");

IDfExportOperation operation = clientx.getExportOperation();

operation.setDestinationDirectory( destDir );

IDfExportNode node = (IDfExportNode)operation.add( sysObj );

node.setFormat( exportFormat );


System.out.println( "exported file path: " + node.getFilePath() );

} catch (DfException e) {
} catch (Exception e2) {
} finally {
System.out.println("export finished.");


this is how I invoke the method

this.doExport(docId, "C:/dll", "new_report", "docx", workitem.getSession());

Whenever I call this export method, an exception will be thrown at the execution line in bold:


The error thrown is as follows:
at com.documentum.operations.impl.DfOperation.getFileExtensionToUse(DfOperation.java:2022)
at com.documentum.operations.nodeactions.outbound.impl.DfGetContentFile.getDefaultOutputFile(DfGetContentFile.java:101)
at com.documentum.operations.nodeactions.outbound.impl.DfGetContentFile.getContentFile(DfGetContentFile.java:862)
at com.documentum.operations.nodeactions.outbound.impl.DfGetContentFile.execute(DfGetContentFile.java:73)
at com.documentum.operations.steps.impl.DfOperationStep.execute(DfOperationStep.java:130)
at com.documentum.operations.impl.DfOperation.execute(DfOperation.java:437)
at com.pcs.inbox.ServiceRequestMsgBody.doExport(ServiceRequestMsgBody.java:1600)
at com.pcs.inbox.ServiceRequestMsgBody.doProcessCall(ServiceRequestMsgBody.java:875)
at com.pcs.inbox.ServiceRequestMsgBody.genTemplate(ServiceRequestMsgBody.java:827)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.documentum.web.form.FormProcessor.invokeMethod(FormProcessor.java:1562)
at com.documentum.web.form.FormProcessor.fireActionEvent(FormProcessor.java:1271)
at com.documentum.web.form.RecallOperation.execute(RecallOperation.java:101)
at com.documentum.web.form.FormProcessor.processAction(FormProcessor.java:107)
at com.documentum.web.form.FormAction.processAction(FormAction.java:107)
at com.documentum.web.env.WDKController.doStartRequest(WDKController.java:191)
at com.documentum.web.env.WDKController.processRequest(WDKController.java:92)
at com.documentum.web.env.WDKController.doFilter(WDKController.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)

Any idea what went wrong here? Is exporting of docx document type supported in documentum 6.0? And if not, are there any recommended workaround?

PS: I am not able to change the file type to a doc file due to some requirements stated by my users. So I have to work with the docx file format. Any help is greatly appreciated. Thanks in advance.
  • 1. Re: Export operation using DFC
    Jørg Krause

    you're passing docx as exportFormat to your routine, but IDfExportNode.setFormat() does expect a Documentum format, attribute a_content_type.

    You specify the format if you want to export renditions or any other additional format.

    Just remove the line, and try again.


  • 2. Re: Export operation using DFC

    You are right. docx is indeed invalid. The correct argument should be msw12. Thanks for pointing that out.
  • 3. Re: Export operation using DFC
    hi silver
    when you try your code
    the export operation runs correctly
    but if you have a client and a server
    and run your code on the client then the export process runs to the server
    which is not correct
    PLZ ... If any body have an idea to solve this problem
    can write plz
  • 4. Re: Export operation using DFC
    Jørg Krause
    Hi Zidane,

    welcome to forum.

    Your question is not quite clear, I'm afraid.

    In addition, plz don't extend other threads, but open new ones, and refer to existing one.

    Thank you

  • 5. Re: Export operation using DFC
    Thanks Jorg for your response
    and about my question
    I've writing the following code to export a single file.
    in Documentum WDK 5.3
    public void Export(String objectId,String path){
    IDfClientX clientx = new DfClientX();
    IDfSession session=this.getDfSession();
    try {
    IDfExportOperation operation = clientx.getExportOperation();
    IDfSysObject myObj = (IDfSysObject) session.getObject(clientx.getId(Exp_obj));
    IDfExportNode node = (IDfExportNode)operation.add(myObj);
    boolean exeFlag=operation.execute();
    } catch (DfException e) {
    //System.out.println("Query executed.");
    String Exp_obj=args.get("objectId");
    But the export operation done on the server not on the client machine
    ==>The file send to the server
    How can I send the exported files to the client
    I'm waiting your response
    than you
  • 6. Re: Export operation using DFC
    I see what you mean. Have you found a way to resolve this yet?
  • 7. Re: Export operation using DFC
    hi silver
    Until now the problem can't be resolved
    If you have any idea please reply
  • 8. Re: Export operation using DFC
    nah...no luck with it yet.
  • 9. Re: Export operation using DFC
    Raj Gopal

    In your original post, you said the null pointer is at
    at com.documentum.operations.impl.DfOperation.getFileExtensionToUse

    Do you get any result for this DQL
    SELECT dos_extension FROM dm_format WHERE (name = 'msw12');

    Can you post your latest errors?

  • 10. Re: Export operation using DFC
    I actually managed to get that to work. The problem that we have now is pertaining to another issue that Zidane previously highlighted. The problem surfaces when we host our app in a client-server environment. When the user browse for a file using the file browser (the <dmf:filebrowse> control) he is selecting the file from his local machine. However when he uploads the file to the content server, documentum actually looks for that file in the web server (we are referring to another remote server here) which may not contain that file. As a result, a file not found exception is thrown.

    Any idea what went wrong?