Export operation using DFC
Hi,
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.");
return;
}
//System.out.println("ServiceRequestMsgBody.java: start doExport 2");
sysObj.setObjectName(exportName);
IDfExportOperation operation = clientx.getExportOperation();
operation.setDestinationDirectory( destDir );
IDfExportNode node = (IDfExportNode)operation.add( sysObj );
node.setFormat( exportFormat );
operation.execute();*
System.out.println( "exported file path: " + node.getFilePath() );
} catch (DfException e) {
e.printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
} 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:
operation.execute();
The error thrown is as follows:
java.lang.NullPointerException
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.
Best Answer
-
Hi,
You should call it with
<![CDATA[<span class="jive-thread-reply-body-container">]]>this.doExport(docId, "C:/dll", "new_report", "msw12", workitem.getSession());
Insted of "docx", "msw12" represents the format which have "docx" extension. Do not mix a format's name with it's DOS extension.
Mike
0
Answers
-
Hi,
You should call it with
<![CDATA[<span class="jive-thread-reply-body-container">]]>this.doExport(docId, "C:/dll", "new_report", "msw12", workitem.getSession());
Insted of "docx", "msw12" represents the format which have "docx" extension. Do not mix a format's name with it's DOS extension.
Mike
0 -
I'm glad it's working.
Documentum Administrator -> Formats
It displays the format's name and description. The DOS extension is not showed, but you can see it on it's Info page.
Or you run a query like this:
SELECT name, dos_extension FROM dm_format WHERE dos_extension='docx'
0
Categories
- All Categories
- 109 Developer Announcements
- 49 Articles
- 100 General Questions
- 122 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 122 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management